Failed to load file or assembly "Antlr3.Runtime (1)" or one of its dependencies

I get this error when I try to start my MVC4 project, it worked fine until recently on my other machines, but when I try to start it from another computer, it gives me this error:

Failed to load file or assembly "Antlr3.Runtime (1)" or one of the dependencies. The installed assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

After reading about it here , I tried to do :

Install-Package Antlr3.Runtime -Pre

but it didn’t help, any ideas?

+76
asp.net-mvc
Nov 24 '13 at 20:34
source share
23 answers

I ran into the same problem when experimenting with the free Nlog logging platform.

It helped me:

Enter% TEMP% in Explorer and delete all temporary files.

After that, I did not get an error when starting my MVC5 project in Visual Studio.

+94
Dec 03 '13 at 6:38
source share

Try deleting temporary files for ASP.Net by doing one of the following:

  • Enter% TEMP% in Explorer and delete all temporary files.
  • Go to the folder "C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Temporary ASP.NET Files" and delete all the files.
+39
May 6 '14 at 10:28
source share

Remember to also clear the temporary ASP.NET files in Framework64 . It did the trick for me.

  • C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
  • C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
+29
Jul 17 '14 at 9:16
source share

Just in case, this helps someone.
I had this problem with MVC 5 application. Remove Antlr3.Runtime.dll from the bin directory and repair the problem fix.

+21
Feb 26 '15 at 16:02
source share

My problem was that the latest version of WebGrease installs version 3.4.1.9004 Antlr. As soon as I installed WebGrease and then upgraded Antlr to version 3.5.0.2, the error disappeared.

+17
Dec 02 '14 at 15:53
source share

If any solutions solve your problem, check the web.config build version

 <dependentAssembly> <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" /> </dependentAssembly> 
+10
Jun 20 '14 at 11:26
source share

For me, deleting this node in the web.config file got rid of the error message:

 <identity impersonate="true" userName="" password=""> 

But for me, full access really worked (to the username specified in the impersonation), to the Temporary ASP.NET Files folder found in C: \ Windows \ Microsoft.NET \ Framework {version} (or Framework64).

The identifier can also be stored in the website application pool settings in IIS.

Make sure your nuget package is installed correctly with the correct version. If nothing works, just try re-adding the link from the local folder and set it to Copy local.

+7
May 16 '14 at 17:35
source share

One easy way is to update antlr and webgrease

  • Open the package console manager.
  • then try applying these codes one at a time.
  • PM> Antlr Package Update
  • PM> Update Service Pack Website

Finally fixed bug

+6
Oct. 15 '14 at 5:59
source share

For me, this was caused by a mismatch between Antlr versions of debugging and execution.

Finally solving it by installing another Antlr package: Install-Package Antlr

+2
Aug 26 '14 at 18:54
source share

Try to unlock the Antlr3.Runtime.dll file if you add the link manually: enter image description here

+2
Dec 06 '14 at 13:30
source share

There was a problem with impersonate = "true" in web.config, I deleted the line with which it worked.

Again I placed the line and gave administrator permission to the person with the personified, all my application worked :)

+2
Mar 18 '16 at 15:13
source share

If you use impersonation. The answer is to give the user permission to impersonate access to the following folders:

  1. C:\Windows\Microsoft.NET\Framework[v4.0.30319 or the version that you're using]\Temporary ASP.NET Files

  2. Directory of your site.

You may also need to create a folder as follows:

 C:\Windows\Microsoft.NET\Framework\[v4.0.30319 or the version that you're using]\Temporary ASP.NET Files\[Application-Name-Goes-Here] 

But first try the previous one, it worked for me.

These two changes gave the impersonated user permission to save temporary data, as well as receive dll files and any necessary files from directories.

Update, for Windows 10 This is a solution that worked for me

We will do both steps, but instead of C:\Windows\Microsoft.NET\Framework[v4.0.30319 or the version that you're using]\Temporary ASP.NET Files

Write% TEMP% to Explorer and give the user permission to impersonate access to the following folder: C:\Users\[UserName]\AppData\Local\Temp\Temporary ASP.NET Files

+1
Feb 08 '18 at 13:43
source share

In the project, I had a link to WebGrease, but there was no corresponding element in packages.config. I am removing the link from the project because I no longer need it. Now it works.

0
Jan 18 '15 at 20:25
source share

I tried all the answers in this post, but none of them worked for me.

So, I deleted all the / bin directories inside all the projects from my solution, cleaned and rebuilt the solution, and it will finally work!

All my morning spent time figuring out a problem ...

0
May 08 '15 at 15:45
source share

what worked for me was to remove the identifier = true from my webconfig (in the system.web properties) and create the solution again and publish it again (if necessary), and it worked like a charm!

0
Apr 04 '16 at 12:39 on
source share

My problem is ultimately caused by a change in mapped drives in our group policy. My solution has the tempDirectory parameter set in Web.config to use the RAM disk as my Z: drive. Apparently, they started using the Z: drive and the DLLs were copied to tempDirectory as usual, but I think they were deleted by the process on the remote server (possibly virus detection). I was able to figure this out using Process Monitor and filtering for Antlr and seeing what it was looking for in a network location for the DLL.

0
Aug 15 '16 at 15:02
source share

I updated all packages in Nudget Package Manager and it worked! In my case, I host my site in GoDaddy

0
Feb 19 '17 at 19:47
source share

After trying to delete the temporary .netframework file without success, I changed

 <system.web> <authentication mode="None" /> <compilation debug="true" targetFramework="4.6.1" /> <httpRuntime /> <pages controlRenderingCompatibilityVersion="4.0" /> </system.web> 

Only with targetFramework = "4.6" instead of 4.6.1. The website is displayed without errors. Then I changed it to targetFramework = "4.6.1" again and restarted the server. Everything remains in order.

0
Jul 05 '17 at 11:31 on
source share

For me, the solution was to start Visual Studio as an administrator. This seems to be a permissions issue.

0
Sep 16 '17 at 9:55 on
source share

The solution for me was to go to Tools> NuGet Package Manager> Package Management for the solution

Then hit Antlr3 and make sure it has been installed to:

  • Launch project
  • Any libraries using reflection
  • Any libraries that invoke libraries that use reflection

In my case, it was 4 projects in which it was necessary. Once this was done, this problem was finally resolved.

0
Nov 17 '17 at 15:10
source share

I just ran into this problem and tried the above solutions, but so far nothing has worked. I had to remove the dll from the bin floder and rebuild and then delete all the freed files from the package folder and restore the packages using the package manager console.

0
May 31 '18 at 6:15
source share

% Temp% removed

Deleted cart

Deleted .vs

Now it works for me

0
Dec 27 '18 at 12:09 on
source share

In my case, when I cloned a project, Visual Studio 2019 replaced the white character with "% 20" in the project path. Then, when VS tried to find packages of nuggets, he could not find the correct path.

0
Apr 09 '19 at 15:56
source share



All Articles