加入收藏 | 设为首页 | 会员中心 | 我要投稿 安卓应用网 (https://www.0791zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 程序设计 > 正文

.net – 无法加载文件或程序集“AutoMapper”或其依赖项之一

发布时间:2020-05-23 12:06:23 所属栏目:程序设计 来源:互联网
导读:我部署时遇到这个问题,我真的不知道如何解决它.任何的想法? Server Error in / Application.Could not load file or assembly AutoMapper or one of its dependencies. This assembly is built by a runtime newer than the currently loa

我部署时遇到这个问题,我真的不知道如何解决它.任何的想法?

Server Error in '/' Application.
Could not load file or assembly 'AutoMapper' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

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

Exception Details: System.BadImageFormatException: Could not load file or assembly 'AutoMapper' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

Source Error: 

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

Assembly Load Trace: The following information can be helpful to determine why the assembly 'AutoMapper' could not be loaded.


=== Pre-bind state information ===
LOG: User = IIS APPPOOLDefaultAppPool
LOG: DisplayName = AutoMapper
(Partial)
LOG: Appbase = file:///C:/inetpub/wwwroot/
LOG: Initial PrivatePath = C:inetpubwwwrootbin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:inetpubwwwrootweb.config
LOG: Using host configuration file:C:WindowsMicrosoft.NETFramework64v2.0.50727Aspnet.config
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework64v2.0.50727configmachine.config.
LOG: Policy not being applied to reference at this time (private,custom,partial,or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/Temporary ASP.NET Files/root/e22c2559/92c7e946/AutoMapper.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/Temporary ASP.NET Files/root/e22c2559/92c7e946/AutoMapper/AutoMapper.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/bin/AutoMapper.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8013101b). Probing terminated.

Stack Trace: 


[BadImageFormatException: Could not load file or assembly 'AutoMapper' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.]
 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,Boolean forIntrospection) +416
  System.Reflection.Assembly.InternalLoad(String assemblyString,Boolean forIntrospection) +166
  System.Reflection.Assembly.Load(String assemblyString) +35
  System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName,Boolean starDirective) +190

 [ConfigurationErrorsException: Could not load file or assembly 'AutoMapper' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.]
 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName,Boolean starDirective) +11224200
     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): Could not load file or assembly 'AutoMapper' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.]
  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): Could not load file or assembly 'AutoMapper' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.]
  System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11318198
  System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
  System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr,HttpContext context) +4348404

版本信息:Microsoft .NET Framework版本:2.0.50727.5446; ASP.NET版本:2.0.50727.5420

应用程序池配置为.NET 2.0:

Version Information: Microsoft .NET Framework Version:2.0.50727.5446;
ASP.NET Version:2.0.50727.5420

部署的AutoMapper程序集是为.NET 4.0构建的:

“This assembly is built by a runtime newer than the currently loaded
runtime and cannot be loaded.”

这不会一起工作.您可以通过将应用程序池切换到.NET 4.0来解决此问题.

(编辑:安卓应用网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读