Last post Jan 28, 2021 03:43 PM by bloopo9
Jan 28, 2021 02:58 PM|bloopo9|LINK
We have a pre-compiled MVC application that is seeing the 'The file [.cshtmls file] has not been pre-compiled, and cannot be requested' errors periodically. What we have found is that in the C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET
Files\<application name in IIS> directory, there are files with names similar to 'App_web__contenttitle.cshtml.639c3968.dll.delete' that when deleted, the error goes away and the application starts working again. If this file is not deleted, the application
will not run. It appears these files are created as part of the JIT compile on app startup, and that the JIT compilation should be removing these files, but for some reason isn't removing them sometimes. We believe virus scanners on the server could potentially
be locking these files, preventing them from being deleted. However, we have also seen this behavior happen even when virus scanners add the location to their exception list.
We believe this is currently happening on .NET Framework versions 4.5 to 4.7, these are the current versions run on various deployments.
Is there another reason these *.delete files might be hanging around causing problems? Should we look into using NGen.exe to do the compilation instead of JIT?
Jan 28, 2021 03:00 PM|mgebhard|LINK
I've seen this situation when deploying over a running application.
Jan 28, 2021 03:43 PM|bloopo9|LINK
Thanks! Our deployment tool is supposed to stop IIS before deploying, but that gives me something to look into, maybe that tool has a bug with that or something.