I am experiencing this problem very often at my hosting server.
The error starts happening occasionally for random DLL and until I ftp the web.config file again (even the same file), the error goes and the site starts working fine.
I am posting the exception and stack trace below.
Please help...
Exception: error CS0006: Metadata file 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root...\some.dll' could not be found
Stack Trace: at System.Web.Compilation.BuildManager.PostProcessFoundBuildResult(BuildResult result, Boolean keyFromVPP, VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetBuildResultFromCacheInternal(String cacheKey, Boolean keyFromVPP, VirtualPath virtualPath, Int64 hashCode) at System.Web.Compilation.BuildManager.GetVPathBuildResultFromCacheInternal(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(Http开发者_开发问答Context context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.UI.BaseTemplateParser.GetReferencedType(VirtualPath virtualPath, Boolean allowNoCompile) at System.Web.UI.BaseTemplateParser.GetUserControlType(VirtualPath virtualPath) at System.Web.UI.MainTagNameToTypeMapper.ProcessUserControlRegistration(UserControlRegisterEntry ucRegisterEntry) at System.Web.UI.MainTagNameToTypeMapper.TryUserControlRegisterDirectives(String tagName)
Mostly likely, you're forcing a recompile while the server is under load. This can have unpredictable effects. ASP.NET does dynamic recompilation, but if you're deploying multiple files you can get a geometric expansion of the nummber of dynamic recompiles required to swallow your whole code migration. Redeploying web.config probably kind of resets the compile process.
Recycling your app pool will clear such a problem, but you may lack that access. Deploying off-peak can probably mitigate the problem.
The best answer for this please open you web.config file and add below two setting add in the compilation tag
<compilation targetFramework="4.0" debug="false" batch="false">
Keep coidng, Also i tried following things when i get the same error in my application which i tried to host in the server
Click Start, click Run, type iisreset /stop, and then click OK.
Open the C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files directory.
Delete all files and all folders in the directory that you located in step
Click Start, click Run, type iisreset /start, and then click OK.
Do a build again and then try to access your site.
精彩评论