Skip to main content

Could not load file or assembly ‘Antlr3.Runtime’ or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

How to fix this weird project error with in a very simple way?

Posted in IIS, Tutorials, ASP.NET

I just had a weird issue with my project: I’ve hit Ctrl+F5 to run and the browser opens. So far, everything ok. When I was going to attach the process I got a BSOD.

As if that wasn’t weird enough I got the error below after restarting everything and running my project again:

Could not load file or assembly ‘Antlr3.Runtime’ or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) Antlr3.Runtime

Luckily someone had this issue before (thanks Cloud Developer!) and I was able to solve it easily. What is the solution? Just empty your %TEMP% folder. Here is how:

  1. Click the Start button and then Run (or press Win+R)
  2. Type: %TEMP% in the box
  3. Click the OK button (The directory for temporary files opens)
  4. Select all files (press CTRL+A)
  5. Press the DELETE key on your keyboard

You don’t need to delete all files, but just the right ones. In case it doesn’t work and you need to delete all files it’s recommended to close all programs (even those on the system tray – beside the clock) and repeat the steps above.

Did you like the article?

You can subscribe and get them as soon they are online, share using the buttons bellow or leave a comment.

And you also can share using your favorite social network:

Using web.config to make your ASP.NET project accept LESS CSS

Learn how to solve the 404 error you get when you try to run an ASP.NET project with .less files

Posted in IIS, Tutorials, ASP.NET, Configuration

Every ASP.NET developer must love the web.config file. Seriously, I will write about it some day. :-)

Some time ago, we have faced a very interesting problem in one of our ASP.NET projects. We have decided to use LESS CSS in order to optimize the front-end development and speed up the things a bit. While we knew that we should compile the LESS files before throw it to production we were facing an error during the development phase:

HTTP Error 404.3 - Not Found

The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

The reason: IIS doesn’t support .less files by default.

By this time we have 2 solutions: The first one is to call the responsible for the webserver and ask him to add a new MIME type into the IIS. But thanks to the .NET architecture we don't need to do that. All we need to do is to add some extra lines to your web.config, inside , as seen bellow:

<system.webServer>
  <staticContent>
    <remove fileExtension=".less" />
    <mimeMap fileExtension=".less" mimeType="text/css" />
  staticContent>
system.webServer>

As you saw it’s simple, clear and useful. Keep in mind that you can use the same method to solve the problem with other non-supported files such as webfonts (.eot, .woof), videos (.mp4, .ogg, .m4v), images (.svg, .svgx) and so on (as Mads Kristensen wrote).

Did you like the article?

You can subscribe and get them as soon they are online, share using the buttons bellow or leave a comment.

And you also can share using your favorite social network:

Fixing the annoying IIS error: Cannot open database requested by the login

Cannot open database _Database Name_ requested by the login. The login failed. Login failed for user _User_

Posted in IIS, Tutorials

While I was developing this blog I got a very nice error right after setup the IIS 7 on my machine:

Cannot open database requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\davidsonsousa.net'.

Why does it happens?

It happens because once you create an Application Pool (in my case davidsonsousa.net), the IIS will create a virtual account with its name (IIS APPPOOL/davidsonsousa.net) and run the Application Pool's worker processes under this account. And, I suppose, as the database doesn't have this account setup you will get this error. [more]

How to fix it?

Before you run to your SQL Server and create this account there I would advice you to do the following:

  1. Open IIS Manager
  2. Go to the Application Pools node
  3. Right click on the Application Pool you would like to change and select "Advanced settings..."
  4. Select the "Identity" list item and click the button with the three dots
  5. In the new window, select the Identity Type "LocalSystem" from the combo box
  6. Confirm everything and restart the website.

Now you will be able to run your website without any problems.

Did you like the article?

You can subscribe and get them as soon they are online, share using the buttons bellow or leave a comment.

And you also can share using your favorite social network: