我正在尝试在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,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 module,Int32 typeToken,RuntimeTypeHandle [] typeInstantiationContext,RuntimeTypeHandle [] methodInstantiationContext)+180 System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken,Type [] genericTypeArguments,Type [] genericMethodArguments)+192 System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord,MetadataImport scope,Assembly& lastAptcaOkAssembly,RuntimeModule decoratedModule,MetadataToken decoratedToken,RuntimeType attributeFilterType,Boolean mustBeInheritable,Object [] attributes,IList derivedAttributes,RuntimeType& attributeType,IRuntimeMethodInfo& ctor,Boolean& ctorHasParameters, Boolean& isVarArg)+115 System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule,Int32 decoratedMetadataToken,Int32 pcaCount,RuntimeType attributeFilterType,Boolean mustBeInheritable,IList derivedAttributes,Boolean isDecoratedTargetSecurityTransparent)+426 System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly,RuntimeType caType)+103 System.Reflection.RuntimeAssembly.GetCustomAttributes(Type attributeType,Boolean inherit)+64 WebActivator.AssemblyExtensions.GetActivationAttributes(程序集)+113 WebActivator.ActivationManager.RunActivationMethods()+216 WebActivator.ActivationManager.RunPreStartMethods()+28 WebActivator.ActivationManager.Run()+55
[InvalidOperationException:预应用程序启动初始化 方法在WebActivator.ActivationManager类型上运行引发异常 带有以下错误消息:无法加载文件或程序集 'System.Core,Version = 2.0.5.0,Culture = neutral, PublicKeyToken = 7cec85d7bea7798e,Retargetable = Yes'或其中一个 依赖。给定的程序集名称或代码库无效。 (HRESULT的例外情况:0x80131047)。] System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 方法)+423
System.Web.Compilation.BuildManager.CallPreStartInitMethods()+ 306 6 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager,IApplicationHost appHost,IConfigMapPathFactory configMapPathFactory,HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel,Exception appDomainCreationException)+591[HttpException(0x80004005):预应用程序启动初始化 方法在WebActivator.ActivationManager类型上运行引发异常 带有以下错误消息:无法加载文件或程序集 'System.Core,Version = 2.0.5.0,Culture = neutral, PublicKeyToken = 7cec85d7bea7798e,Retargetable = Yes'或其中一个 依赖。给定的程序集名称或代码库无效。 (HRESULT的例外情况:0x80131047)。] System.Web.HttpRuntime.FirstRequestInit(HttpContext context)+8946484 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)+97 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) 258
是IIS6相关的问题,还是我在服务器上遗漏了什么?