System.Web.HttpCompileException (0x80004005)

2020-02-28 19:27发布

问题:

My .net 4 intranet application works fine almost all the time. Sometimes, without making any change, it starts giving 500 exceptions with the following message:

System.Web.HttpCompileException (0x80004005): External component has thrown an exception. 
at System.Web.Compilation.AssemblyBuilder.Compile() 
at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() 
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) 
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) 
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) 
at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) 
at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) 

The only solution is the stop the inet service, delete C:\Windows\Microsoft.Net..\Temporary files and then everything starts working again.

Any ideas? Thanks!

回答1:

Try to clean temp asp.net files in C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files



回答2:

The solution is to clean the Asp.Net Temporary files or recycle the IIS pool.

Read more on Microsoft support



标签: asp.net iis-7