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

I think you recognize this: you’re in the middle of developping software, everything runs smoothly and you progresses quickly. But suddenly this feeling of happiness stops when you see an error like this: 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

You have really no clue where to find, but one thing is for sure: it’s not in your code, because you didn’t changed anything.

It happened to me when developping an MVC 4 .net 4.5 webapp. After extensive search the solution is (as usual) simple:

empty your %TEMP% folder:

  • close all programs that you are using (the one in the system tray included)
  • Click the start button
  • click Run
  • type: %TEMP% in the box
  • click the OK button

Now a the directory for temporary files opens:

  • select all files ( CTRL – A)
  • press the DELETE key on your keyboard
  • acknowledge that you want to delete all files

Hopes it helps you to save a few yours of searching

CD

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

    • Just one more thing to add. I had to restart some of my services (e.g. sqlexpress, iis-logging, some other iis-* service i can’t remember). For some reason, clearing the temp folder stopped them.

  1. I resolved my problem with you info.But when deploy our solution in production side can we face these kind of problems

  2. In some cases, you will also have to delete temp files from: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files (folder location might vary)

  3. Deleting “C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files” solved my problem and saved my day 😉

  4. Thank you so much. I got a blue screen error while developing my websie, after restarting my system in safe mode i restarted my system and opened my visual studio but while compiling i got
    the same error. thanks a lot. This helpedme to solve the issue

Leave a Reply to Mobeen Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>