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

I find a similar question, but have no solution for my problem.

Failed to load file or assembly "Antlr3.Runtime" or one of the dependencies. This assembly is runtime, currently loaded runtime, and cannot be loaded

I get this error only in IIS. I am trying to install in IIS 7.5. I installed the application pool as 4.0, Integrated.

Previously, everything worked fine. After I installed the 4.5 VS 2012 framework, I got an exception with MachineKeyCryptography. Therefore, I deleted 4.5 framework and VS 2012, due to which this mess occurs.

The exception I get is below.

Description: An unhandled exception occurred during the execution of the current web request. View the stack trace for error information and where it originated in the code.

Exception Details: System.BadImageFormatException: Failed to load file or assembly "Antlr3.Runtime" or one of its dependencies. This assembly is created using a runtime that is newer than the currently loaded runtime and cannot be loaded.

Source Error:

An unhandled exception was thrown during the execution of the current web request. Information about the origin and location of the exception can be identified using the exception stack trace below.

Assembly download trace: The following information may be useful to determine why the Antlr3.Runtime assembly could not be downloaded.

WRN: . , [HKLM\Software\Microsoft\Fusion! EnableLog] (DWORD) 1. : , . , [HKLM\Software\Microsoft\Fusion! EnableLog].

:

[BadImageFormatException: "Antlr3.Runtime" . , , .] System.Reflection.Assembly._nLoad (AssemblyName _, codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark & ​​; stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark & stackMark, Boolean forIntrospection) +416
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark & stackMark, Boolean forIntrospection) +166 System.Reflection.Assembly.Load(String assemblyString) +35
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +190

[ConfigurationErrorsException: "Antlr3.Runtime" . , , .]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +11244040
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +388 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +232
System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +48
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +210
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +76 System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +283
System.Web.Compilation.BuildManager.CompileGlobalAsax() +50
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +676

[HttpException (0x80004005): "Antlr3.Runtime" . , , .]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +76 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +1012 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +1025

[HttpException (0x80004005): "Antlr3.Runtime" . , , .] System.Web.HttpRuntime.FirstRequestInit(HttpContext ) +11338038
System.Web.HttpRuntime.EnsureFirstRequestInit( HttpContext) +88 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext) +4356276

+3
3

u IIS. . , .

→ → →

, , , .Net , 4. , .

, IIS 7.5. , , . , .

+5

lib -. , "rebuild all", , "" Antlr3.runtime.

. , 2 Antlr3.runtime.

:

  • "ctrl +;" "Antlr3" explorer. , ; , .
  • , " ". Antlr3.runtime .
  • , .
  • , . "" .
  • "/ / " ( NuGet). 2 Antlrs3.runtime . .

, . , Antlr3, Newtonsoft.Json .

, , Nuget (Tools/Option/Package Manager/General), , NuGet (, ?). , .

+2

1. temp (%TEMP%)folder
 2. and C:\Windows\Microsoft.NET\Framework\v4.0.30319\TemporaryASP.NET files allow mine. The main cause of the error was the version of the link "Antlr3.Runtime", not the same as that mentioned in web.config.

 <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>

The solution was to upgrade to the latest version of version 3.5.0.2 from Antlrs.Runtime

0
source

All Articles