问题描述
“/WebSite5”应用程序中的服务器错误。--------------------------------------------------------------------------------无法加载引用程序集来执行。说明:执行当前Web请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。异常详细信息:System.BadImageFormatException:无法加载引用程序集来执行。源错误:执行当前Web请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。堆栈跟踪:[BadImageFormatException:无法加载引用程序集来执行。][BadImageFormatException:未能加载文件或程序集“System.EnterpriseServices,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项。不应出于执行的目的加载引用程序集。只能在仅限反射的加载程序上下文中加载引用程序集。(异常来自HRESULT:0x80131058)]System.Reflection.RuntimeAssembly._nLoad(AssemblyNamefileName,StringcodeBase,EvidenceassemblySecurity,RuntimeAssemblylocationHint,StackCrawlMark&stackMark,BooleanthrowOnFileNotFound,BooleanforIntrospection,BooleansuppressSecurityChecks)+0System.Reflection.RuntimeAssembly.nLoad(AssemblyNamefileName,StringcodeBase,EvidenceassemblySecurity,RuntimeAssemblylocationHint,StackCrawlMark&stackMark,BooleanthrowOnFileNotFound,BooleanforIntrospection,BooleansuppressSecurityChecks)+39System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyNameassemblyRef,EvidenceassemblySecurity,StackCrawlMark&stackMark,BooleanforIntrospection,BooleansuppressSecurityChecks)+132System.Reflection.RuntimeAssembly.InternalLoad(StringassemblyString,EvidenceassemblySecurity,StackCrawlMark&stackMark,BooleanforIntrospection)+144System.Reflection.Assembly.Load(StringassemblyString)+28System.Web.Configuration.CompilationSection.LoadAssemblyHelper(StringassemblyName,BooleanstarDirective)+46[ConfigurationErrorsException:未能加载文件或程序集“System.EnterpriseServices,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项。不应出于执行的目的加载引用程序集。只能在仅限反射的加载程序上下文中加载引用程序集。(异常来自HRESULT:0x80131058)]System.Web.Configuration.CompilationSection.LoadAssemblyHelper(StringassemblyName,BooleanstarDirective)+591System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfoai)+68System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSectioncompConfig)+177System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies()+91System.Web.Compilation.BuildManager.CallPreStartInitMethods()+166System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManagerappManager,IApplicationHostappHost,IConfigMapPathFactoryconfigMapPathFactory,HostingEnvironmentParametershostingParameters,PolicyLevelpolicyLevel,ExceptionappDomainCreationException)+693[HttpException(0x80004005):未能加载文件或程序集“System.EnterpriseServices,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项。不应出于执行的目的加载引用程序集。只能在仅限反射的加载程序上下文中加载引用程序集。(异常来自HRESULT:0x80131058)]System.Web.HttpRuntime.FirstRequestInit(HttpContextcontext)+638System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContextcontext)+90System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequestwr)+256
解决方案
解决方案二:
可能是.NET出问题了,修复一下试试,这种问题的原因通常千奇百怪
解决方案三:
我重装了vs2010好几次,结果还是一样的!
解决方案四:
C:WINDOWSMicrosoft.NETFrameworkv4.0.30319aspnet_regiis.exe-i试试,不是重装VS,是重装下.netframeworks
解决方案五:
无法加载程序集,是不是缺少这个程序集?
解决方案六:
引用3楼ayanamireizero的回复:
C:WINDOWSMicrosoft.NETFrameworkv4.0.30319aspnet_regiis.exe-i试试,不是重装VS,是重装下.netframeworks
试了还是不行!
解决方案七:
看来只能重装系统了。
解决方案八:
我也没遇到过,所以我只能不负责任地贴个
解决方案九:
删掉再创建还会么··似乎以前遇到过然后莫名其妙的好了·
解决方案十:
缺少引用程序集?
解决方案十一:
缺什么加什么