4

我正在尝试在 IIS 上运行 ASP MVC 4 应用程序。当我从 Basic 模板发布 MVC 4 应用程序时——除了向导创建的这些之外没有任何依赖项——应用程序工作正常。但是当我发布其他应用程序时,即使用 WebActivator 和许多其他库时,我看到了这个错误:

Could not load file or assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047) 

并完成堆栈跟踪:

[FileLoadException:无法加载文件或程序集“System.Core,版本=2.0.5.0,文化=中性,PublicKeyToken=7cec85d7bea7798e,可重定位=是”或其依赖项之一。给定的程序集名称或代码库无效。(HRESULT 异常:0x80131047)] System.ModuleHandle.ResolveType(RuntimeModule 模块,Int32 typeToken,IntPtr* typeInstArgs,Int32 typeInstCount,IntPtr* methodInstArgs,Int32 methodInstCount,ObjectHandleOnStack 类型)+0 System.ModuleHandle.ResolveTypeHandleInternal(IntTokenModule 模块, , RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) +180 System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) +192 System.Reflection.CustomAttribute。

[InvalidOperationException:在类型 WebActivator.ActivationManager 上运行的预应用程序启动初始化方法引发异常,并显示以下错误消息:无法加载文件或程序集'System.Core,版本 = 2.0.5.0,文化 = 中性,PublicKeyToken = 7cec85d7bea7798e, Retargetable=Yes' 或其依赖项之一。给定的程序集名称或代码库无效。(HRESULT 异常:0x80131047)。]
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 方法)+423
System.Web.Compilation.BuildManager.CallPreStartInitMethods() +306
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager,IApplicationHost appHost,IConfigMapPathFactory configMapPathFactory,HostingEnvironmentParameters hostingParameters,PolicyLevel policyLevel,异常 appDomainCreationException)+591

[HttpException (0x80004005):在类型 WebActivator.ActivationManager 上运行的预应用程序启动初始化方法引发异常,并显示以下错误消息:无法加载文件或程序集'System.Core,版本 = 2.0.5.0,文化 = 中性,PublicKeyToken =7cec85d7bea7798e, Retargetable=Yes' 或其依赖项之一。给定的程序集名称或代码库无效。(HRESULT 异常:0x80131047)。]
System.Web.HttpRuntime.FirstRequestInit(HttpContext 上下文)+8946484 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext 上下文)+97 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest WR)+258

是与 IIS6 相关的问题,还是我在服务器上遗漏了什么?

4

0 回答 0