2011-11-07 3 views
8

私はこの問題を展開するときに、私は本当にそれを解決する方法がわかりません。何か案が?ファイルまたはアセンブリ 'AutoMapper'またはその依存関係の1つを読み込めませんでした

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 APPPOOL\DefaultAppPool 
LOG: DisplayName = AutoMapper 
(Partial) 
LOG: Appbase = file:///C:/inetpub/wwwroot/ 
LOG: Initial PrivatePath = C:\inetpub\wwwroot\bin 
Calling assembly : (Unknown). 
=== 
LOG: This bind starts in default load context. 
LOG: Using application configuration file: C:\inetpub\wwwroot\web.config 
LOG: Using host configuration file:C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Aspnet.config 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.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, 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: 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

答えて

11

アプリケーションプールが.NET 2.0用に設定されている:

バージョン情報:Microsoft .NET Frameworkのバージョン:2.0.50727.5446。 ASP.NETバージョン:2.0.50727.5420

展開AutoMapperアセンブリは、.NET 4.0用に構築されています

「このアセンブリは、現在ロードされて ランタイムより新しいランタイムによって構築されているとすることはできませんロードされました。

これは一緒に機能しません。これはおそらく、アプリケーションプールを.NET 4.0に切り替えることで解決できます。

+0

私がC:\ inetpub \ wwwroot \ binに行くと、アセンブリはそこにあります。 – elranu

+0

答えを更新しました。アセンブリはそこにありますが、古いランタイムにロードすることはできません。 – driis

+0

ありがとう!それは私が私のapppoolをセットアップするのを忘れたのです! – elranu

2

AppPoolを変更してみてください... IISでアプリケーションを右クリックし、管理アプリケーション=>詳細設定=>プールを変更してください。 asp.net v4 poolが私のために働いた...

0

AutoMapper DLLへの参照をチェックしてください - それは間違ったものかもしれません。それを削除して元に戻す必要があるかもしれません。

関連する問題