簡體   English   中英

當前Web請求執行期間發生未處理的異常

[英]An unhandled exception occurred during the execution of the current web request

突然,當我運行我的Web應用程序時,出現此錯誤:

無法加載文件或程序集'file:/// C:\\ Users \\ rafael \\ AppData \\ Local \\ Temp \\ Temporary ASP.NET Files \\ root \\ 284bddf3 \\ 431c8965 \\ App_Web_homepage.aspx.cdcab7d2.vmizb1js.dll'或以下之一它的依賴性。 句柄無效。 (來自HRESULT的異常:0x80070006(E_HANDLE))

這是堆棧跟蹤:

FileLoadException: Could not load file or assembly 'file:///C:\Users\rafael\AppData\Local\Temp\Temporary ASP.NET Files\root\284bddf3\431c8965\App_Web_homepage.aspx.cdcab7d2.vmizb1js.dll' or one of its dependencies. The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +39
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +132
   System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence assemblySecurity) +28
   System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly() +93
   System.Web.Compilation.BuildProvider.CreateBuildResult(CompilerResults results) +60
   System.Web.Compilation.TemplateControlBuildProvider.CreateBuildResult(CompilerResults results) +36
   System.Web.Compilation.BuildProvider.GetBuildResult(CompilerResults results) +16
   System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +9086138
   System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +320
   System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +111
   System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) +125
   System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +52
   System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +31
   System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +40
   System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +167
   System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm) +517

[HttpException (0x80004005): Error executing child request for /homepage.aspx.]
   System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm) +816
   System.Web.HttpServerUtility.Transfer(String path, Boolean preserveForm) +57
   System.Web.HttpServerUtility.Transfer(String path) +32
   photography.Global.Application_BeginRequest(Object sender, EventArgs e) in F:\Web Prog\my work\mcpd\gallery\photography\photography\Global.asax.cs:27
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

我不知道這是怎么回事。 因此,如果能得到任何幫助,我將不勝感激。

您可以選擇stop and restart the website嗎?

從理論上講,這應該recycle the application pool for your site ,這可能足以糾正問題。

希望對您有幫助。

在服務器上執行以下操作:

  1. 打開命令提示符並運行以下命令:
  2. C:\\ WINDOWS \\ Microsoft.NET.NET Framework \\ Framework版本\\ aspnet_regiis.exe -i

可以用應用程序項目的.NET框架替換.NET框架版本的地方。 v2.0.50727或4.0等

再次嘗試運行該應用程序,一切都會好起來的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM