Cas*_*ini 4 .net iis .net-assembly
我找到了一个类似的问题,但没有解决我的问题.
无法加载文件或程序集"Antlr3.Runtime"或其依赖项之一.此程序集由比当前加载的运行时更新的运行时构建,无法加载
我只在IIS中收到此错误.我正在尝试部署到IIS 7.5.我将应用程序池设置为4.0,Integrated.
早些时候一切都很好.在我安装了框架4.5 VS 2012 Express后,我得到了一个例外MachineKeyCryptography.所以我卸载了4.5框架和VS 2012,因为这个混乱正在发生.
我得到的例外情况如下.
描述:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息.
异常详细信息:System.BadImageFormatException:无法加载文件或程序集"Antlr3.Runtime"或其依赖项之一.此程序集由比当前加载的运行时更新的运行时构建,无法加载.
来源错误:
在执行当前Web请求期间生成了未处理的异常.可以使用下面的异常堆栈跟踪来识别有关异常的起源和位置的信息.
程序集加载跟踪:以下信息有助于确定无法加载程序集"Antlr3.Runtime"的原因.
警告:装配绑定日志记录已关闭.要启用程序集绑定失败日志记录,请将注册表值[HKLM\Software\Microsoft\Fusion!EnableLog](DWORD)设置为1.注意:程序集绑定失败日志记录会导致一些性能损失.要关闭此功能,请删除注册表值[HKLM\Software\Microsoft\Fusion!EnableLog].
堆栈跟踪:
[BadImageFormatException:无法加载文件或程序集'Antlr3.Runtime'或其依赖项之一.此程序集由比当前加载的运行时更新的运行时构建,无法加载.] System.Reflection.Assembly._nLoad(AssemblyName fileName,String 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 context)+11338038
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)+88 System.Web.HttpRuntime .ProcessRequestNotificationPrivate(IIS7WorkerRequest wr,HttpContext context)+4356276
你需要在IIS中更改它的运行时版本.右键单击虚拟目录,然后单击高级设置将其更改为正确的池设置.我可以说重新安装后你的游泳池设置不正确.
您可以找到该过程
在应用程序池中 - >选择您的站点 - >设置应用程序池默认值 - >选择正确的版本
如果这不起作用,此时您可以做的首选是从系统中引用框架4卸载所有.Net安装.清理系统,然后重新安装所有内容.
但我发现你使用的是IIS 7.5.因此,您可以发现许多功能变化,需要谨慎处理.您可以尝试在尝试重新安装之前设置应用程序池和其他设置.