我正在尝试在 IIS 上运行 ASP MVC 4 应用程序。当我从基本模板发布 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,Version=2.0.5.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e,Retargetable=Yes”或其依赖项之一。给定的程序集名称或代码库无效。 (HRESULT 异常:0x80131047)]
System.ModuleHandle.ResolveType(RuntimeModule模块,Int32 typeToken,IntPtr * typeInstArgs,Int32 typeInstCount,IntPtr * methodInstArgs,Int32 methodInstCount,ObjectHandleOnStack类型)+0
System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule模块,Int32 typeToken,RuntimeTypeHandle [] typeInstantiationContext,RuntimeTypeHandle [] methodInstantiationContext)+180
System.Reflection.RuntimeModule.ResolveType(Int32metadataToken,类型[] genericTypeArguments,类型[] genericMethodArguments)+192
System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord,MetadataImport范围,Assembly&lastAptcaOkAssembly,RuntimeModuledecoratedModule,MetadataTokendecoratedToken,RuntimeTypeattributeFilterType,BooleanmustBeInheritable,Object[]属性,IList衍生属性,RuntimeType&attributeType,IRuntimeMethodInfo&ctor,Boolean&ctorHasParameters,Boolean&isV精氨酸)+ 115
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModuledecoratedModule,Int32decoratedMetadataToken,Int32pcaCount,RuntimeTypeattributeFilterType,布尔值mustBeInheritable,IList衍生属性,布尔值isDecolatedTargetSecurityTransparent)+426
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly程序集,RuntimeType caType)+103
System.Reflection.RuntimeAssembly.GetCustomAttributes(类型attributeType,布尔继承)+64
WebActivator.AssemblyExtensions.GetActivationAttributes(程序集)+113
WebActivator.ActivationManager.RunActivationMethods() +216
WebActivator.ActivationManager.RunPreStartMethods() +28
WebActivator.ActivationManager.Run() +55
[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
应用程序管理器、IApplicationHost 应用程序主机、IConfigMapPathFactory
configMapPathFactory、 HostingEnvironmentParameters 托管参数、
策略级别 策略级别,异常 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 相关问题,还是我在服务器上丢失了某些内容?
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)