asp.net 疑难杂症

“/”应用程序中的服务器错误。*未能加载文件或程序集“file:///C:\Users\Administrator\AppData\Local\Temp\Temporary ASP.NET Files\vs\068a3124\d2b6c29e\App_global.asax.8flosgkq.dll”或它的某一个依赖项。系统找不到指定的文件。*说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.IO.FileNotFoundException: 未能加载文件或程序集“file:///C:\Users\Administrator\AppData\Local\Temp\Temporary ASP.NET Files\vs\068a3124\d2b6c29e\App_global.asax.8flosgkq.dll”或它的某一个依赖项。系统找不到指定的文件。

源错误:

执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。 程序集加载跟踪: 下列信息有助于确定程序集“file:///C:\Users\Administrator\AppData\Local\Temp\Temporary ASP.NET Files\vs\068a3124\d2b6c29e\App_global.asax.8flosgkq.dll”未能加载的原因。

=== 预绑定状态信息 === 日志: Where-ref 绑定。位置 = C:\Users\Administrator\AppData\Local\Temp\Temporary ASP.NET Files\vs\068a3124\d2b6c29e\App_global.asax.8flosgkq.dll 日志: Appbase = file:///G:/Biyesheji/WebApplication1/WebApplication1/ 日志: 初始 PrivatePath = G:\Biyesheji\WebApplication1\WebApplication1\bin 调用程序集: (Unknown)。 === 日志: 此绑定从 LoadFrom 加载上下文开始。 警告: 将不在 LoadFrom 上下文中探测本机映像。仅在默认加载上下文中探测本机映像,例如,使用 Assembly.Load()。 日志: 正在使用应用程序配置文件: G:\Biyesheji\WebApplication1\WebApplication1\web.config 日志: 使用主机配置文件: d:\Users\Administrator\Documents\IISExpress\config\aspnet.config 日志: 使用 C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config 的计算机配置文件。 日志: 尝试下载新的 URL file:///C:/Users/Administrator/AppData/Local/Temp/Temporary ASP.NET Files/vs/068a3124/d2b6c29e/App_global.asax.8flosgkq.dll。 堆栈跟踪:

[FileNotFoundException: 未能加载文件或程序集“file:///C:\Users\Administrator\AppData\Local\Temp\Temporary ASP.NET Files\vs\068a3124\d2b6c29e\App_global.asax.8flosgkq.dll”或它的某一个依赖项。系统找不到指定的文件。] System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0 System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +37 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +159 System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence assemblySecurity) +35 System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly() +91 System.Web.Compilation.BuildProvider.CreateBuildResult(CompilerResults results) +62 System.Web.Compilation.BuildProvider.GetBuildResult(CompilerResults results) +16 System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +10113585 System.Web.Compilation.BuildManager.CompileGlobalAsax() +47 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +274 [HttpException (0x80004005): 未能加载文件或程序集“file:///C:\Users\Administrator\AppData\Local\Temp\Temporary ASP.NET Files\vs\068a3124\d2b6c29e\App_global.asax.8flosgkq.dll”或它的某一个依赖项。系统找不到指定的文件。] System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +65 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +458 System.Web.Compilation.BuildManager.CallAppInitializeMethod() +35 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +605 [HttpException (0x80004005): 未能加载文件或程序集“file:///C:\Users\Administrator\AppData\Local\Temp\Temporary ASP.NET Files\vs\068a3124\d2b6c29e\App_global.asax.8flosgkq.dll”或它的某一个依赖项。系统找不到指定的文件。] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10080064 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +99 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +263 版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.8.9282.0

原因

编译乱入

  <system.web>
    <!--<customErrors mode="Off"/>--> 
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="zh-CN" uiCulture="zh-CN"/>
    <compilation debug="true" targetFramework="4.8"/>
    <httpRuntime targetFramework="4.7.2"/>
  </system.web>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701"/>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
    </compilers>
  </system.codedom>
  <runtime>

删除

  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701"/>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
    </compilers>
  </system.codedom>