我有以下问题,当我试图建立我的网站时,第二次网页显示给我这个。我想找个解决办法,但我还没有找到。当我第一次加载项目时,所有功能都运行良好,问题是当我关闭计算机,第二次启动项目时。
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
发布于 2020-05-02 18:15:07
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重新编译该项目。停止使临时文件的程序
现在我们已经停止了主编译器,我们转到,清除所有可能的缓存和临时文件。对于删除,也可以使用一个程序(如总指挥官)来查看隐藏的文件。
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\
这里的所有文件和目录以及计算机上存在的所有Temporary ASP.NET Files
取决于您如何运行项目32/64位以及您使用的版本.cd %temp%
,在那里删除所有文件-左锁定的文件,您不能删除.c:\windows\temp
上可以找到的其他临时系统windows目录。.vs
隐藏缓存目录--只有在visual studio和项目出现问题和延迟时才能清除。现在放开,重新运行程序
现在你的问题必须解决。要避免文件损坏,请检查您的计算机是否有足够的空闲空间,检查系统上的日期时间,而不强制关闭系统。检查硬盘中是否有错误--打开命令提示符窗口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
上改变的东西.
其他可能的原因
检查事件查看器,看看是否有指示编译器崩溃的行!
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中关于编译器的部分是否正确-下面是一个示例:
<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>
https://stackoverflow.com/questions/61562284
复制相似问题