首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法加载文件或程序集

无法加载文件或程序集
EN

Stack Overflow用户
提问于 2020-05-02 15:58:01
回答 1查看 4.4K关注 0票数 2

我有以下问题,当我试图建立我的网站时,第二次网页显示给我这个。我想找个解决办法,但我还没有找到。当我第一次加载项目时,所有功能都运行良好,问题是当我关闭计算机,第二次启动项目时。

带有误差的图像

代码语言:javascript
运行
复制
Server Error in '/' Application.
Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\8414c445\dc4fe894\App_global.asax.7hmxt1lb.dll' or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\8414c445\dc4fe894\App_global.asax.7hmxt1lb.dll' or one of its dependencies. The system cannot find the file specified.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'file:///C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\8414c445\dc4fe894\App_global.asax.7hmxt1lb.dll' could not be loaded.


WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Stack Trace:


[FileNotFoundException: Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\8414c445\dc4fe894\App_global.asax.7hmxt1lb.dll' or one of its dependencies. The system cannot find the file specified.]
   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.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +232
   System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence assemblySecurity) +62
   System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly() +119
   System.Web.Compilation.BuildProvider.CreateBuildResult(CompilerResults results) +74
   System.Web.Compilation.BuildProvider.GetBuildResult(CompilerResults results) +22
   System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +12028905
   System.Web.Compilation.BuildManager.CompileGlobalAsax() +52
   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +341

[HttpException (0x80004005): Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\8414c445\dc4fe894\App_global.asax.7hmxt1lb.dll' or one of its dependencies. The system cannot find the file specified.]
   System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +76
   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +631
   System.Web.Compilation.BuildManager.CallAppInitializeMethod() +38
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +758

[HttpException (0x80004005): Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\8414c445\dc4fe894\App_global.asax.7hmxt1lb.dll' or one of its dependencies. The system cannot find the file specified.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +552
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +122
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +737

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4110.0
EN

回答 1

Stack Overflow用户

发布于 2020-05-02 18:15:07

代码语言:javascript
运行
复制
when I turned off my computer and I start with the project by the second time

我怀疑你把它关掉了--但是很多文件没有正确地写回磁盘.

指出

错误发生在Temporary ASP.NET Files目录上-- asp.net automatically生成文件--这与代码无关(至少在大多数情况下)--但问题与asp.net编译器有关。

一般观念

停止使用的程序并清除缓存和临时文件,然后再次运行它们。

我遵循的步骤

我建议执行哪些步骤并清除缓存,以便IIS/asp.net/cs重新编译该项目。停止使临时文件的程序

  1. 检查C驱动器上是否有空闲空间。
  2. 关闭所有Visual程序
  3. 打开“服务”并停止IIS“万维网发布服务”

现在我们已经停止了主编译器,我们转到,清除所有可能的缓存和临时文件。对于删除,也可以使用一个程序(如总指挥官)来查看隐藏的文件。

  1. 清除asp.net临时目录- >C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\这里的所有文件和目录以及计算机上存在的所有Temporary ASP.NET Files取决于您如何运行项目32/64位以及您使用的版本.
  2. 清除临时窗口临时目录。键入cd %temp%,在那里删除所有文件-左锁定的文件,您不能删除.
  3. 清除在c:\windows\temp上可以找到的其他临时系统windows目录。
  4. 可以选择清除位于项目目录上的.vs隐藏缓存目录--只有在visual studio和项目出现问题和延迟时才能清除。

现在放开,重新运行程序

  1. 再次运行“服务”并启动IIS“万维网发布服务”
  2. 运行视频演播室,给他一点时间重新编译什么是需要的.

现在你的问题必须解决。要避免文件损坏,请检查您的计算机是否有足够的空闲空间,检查系统上的日期时间,而不强制关闭系统。检查硬盘中是否有错误--打开命令提示符窗口cmd,运行chkdsk c: /f检查并修复任何错误。

关于临时目录

临时目录在每台计算机上都不是相同的。您可以在“控制面板”、“系统”、“系统属性”、“系统属性”、“环境变量”( -> )、“TEMP”和“TMP”中找到它们。当您键入cd %temp%时,您将转到临时目录,但许多程序在不同的帐户下运行,例如windows有c:/windows/temp/目录供使用。

关于asp.net临时目录。默认情况下,此目录位于c:\Windows\Microsoft.NET\Framework64\上64位,在那里定位版本,然后定位Temporary ASP.NET Files。这是你可以在你的网络应用的web.config上改变的东西.

其他可能的原因

检查事件查看器,看看是否有指示编译器崩溃的行!

代码语言:javascript
运行
复制
Application: csc.exe Framework Version: v###### Description: The process was terminated due to an unhandled exception. Exception Info: System.IO.FileNotFoundException at Microsoft.CodeAnalysis.CSharp.CommandLine.Program.Main(System.String[])

在这种情况下,您可能会在全局调用中使用任何非asp.net网函数或任何挂起编译器的错误.还请检查您的web.config中关于编译器的部分是否正确-下面是一个示例:

代码语言:javascript
运行
复制
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" 
      type="Microsoft.CSharp.CSharpCodeProvider, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
        <providerOption name="CompilerVersion" value="v4.0"/>
        <providerOption name="WarnAsError" value="false"/>
      </compiler>
    </compilers>
  </system.codedom>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61562284

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档