这是一个C#Razor WebPages项目...我似乎无法弄清楚这里出了什么问题。我一直试图从我的web.config文件中删除依赖项,但似乎没有任何效果。
有人可以帮忙吗?
[BadImageFormatException: Cannot load a reference assembly for execution.]
[BadImageFormatException:无法加载文件或程序集 'System.Diagnostics.Debug'或其依赖项之一。参考 程序集不应加载以执行。他们只能是 在“仅反射”加载器上下文中加载。 (来自HRESULT的异常: 0x80131058)] System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName,字符串codeBase,证据程序集安全性,RuntimeAssembly locationHint,StackCrawlMark&stackMark,IntPtr pPrivHostBinder, 布尔值throwOnFileNotFound,布尔值用于自省,布尔值 hibitSecurityChecks)+0
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,证据assemblySecurity,RuntimeAssembly reqAssembly, StackCrawlMark&stackMark,IntPtr,pPrivHostBinder,布尔值 throwOnFileNotFound,用于自检的布尔值,布尔值 hibitSecurityChecks)+225
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, 证据集安全性,StackCrawlMark和stackMark,IntPtr pPrivHostBinder,用于自省的布尔值)+110
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, 证据汇编安全性,StackCrawlMark和stackMark,布尔值 forIntrospection)+22 System.Reflection.Assembly.Load(字符串 assemblyString)+34
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(字符串 assemblyName,布尔型starDirective)+48[ConfigurationErrorsException:无法加载文件或程序集 'System.Diagnostics.Debug'或其依赖项之一。参考 程序集不应加载以执行。他们只能是 在“仅反射”加载器上下文中加载。 (来自HRESULT的异常: 0x80131058)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(字符串 assemblyName,布尔型starDirective)+767
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +256 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)+58
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig)+281
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +69 System.Web.Compilation.BuildManager.CallPreStartInitMethods(字符串 preStartInitListPath,布尔值和isRefAssemblyLoaded)+137
System.Web.Compilation.BuildManager.ExecutePreAppStart()+172
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager,IApplicationHost,appHost,IConfigMapPathFactory configMapPathFactory,HostingEnvironmentParametershostingParameters, PolicyLevel policyLevel,异常appDomainCreationException)+848[HttpException(0x80004005):无法加载文件或程序集 'System.Diagnostics.Debug'或其依赖项之一。参考 程序集不应加载以执行。他们只能是 在“仅反射”加载器上下文中加载。 (来自HRESULT的异常: 0x80131058)] System.Web.HttpRuntime.FirstRequestInit(HttpContext 上下文)+532
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext上下文) +111 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr,HttpContext上下文)+714