0

I have a precompiled ASP.NET 4.5 web application that goes from working to errorring with the message:

System.Web.HttpException: The file '' has not been pre-compiled, and cannot be requested.

I’ve seen this before during deployments when not all of the precompiled files have been replaced in the bin folder. However in this case nothing has been updated or changed on the server.

From the way the error just starts appearing it seems as if the app pool is being recycled and the new worker process is having a file access problem. Nothing shows in either the application or system event logs indicating the app pool is being recycled (even with all of the app pool setting set to log all app pool events) or the app domain crashed/unloaded.

Doing an app pool recycle or iisreset fixes the issue and iis is able to serve the application again.

What could cause this type of behavior?

Environment

  • Windows 2016 Datacenter
  • Application is on the local drive
  • Running under a domain account
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Aaron
  • 511
  • 3
  • 25
  • Does this answer your question? [How to fix ASP.NET error "The file 'nnn.aspx' has not been pre-compiled, and cannot be requested."?](https://stackoverflow.com/questions/602117/how-to-fix-asp-net-error-the-file-nnn-aspx-has-not-been-pre-compiled-and-can) – Prashant Pimpale Nov 26 '19 at 05:19
  • On Windows Server 2016 you won't be able to use .NET Framework 4.5. Very likely you hit a bug https://stackoverflow.com/questions/55272598/sporadic-error-the-file-has-not-been-pre-compiled-and-cannot-be-requested – Lex Li Nov 26 '19 at 05:30
  • @PrashantPimpale the issue is not that they are uncompiled or a mix of compiled vs not. It’s that the goes from running just fine to all of a sudden returning the page in the request is not precompiled. – Aaron Nov 26 '19 at 22:51
  • @LexLi not sure what you mean by not being able to use .net 4.5 framework on server 2016. Could you elaborate? The bug looks promising how ever I don’t see the .deleted files it talks about and we aren’t running 4.7. – Aaron Nov 26 '19 at 22:53
  • Windows Server 2016 ships with .NET Framework 4.6, so you are stuck on that version. Since you are not using 4.7, that bug is also irrelevant. In general you should contact Microsoft support, as debugging such issues is not easy. – Lex Li Nov 26 '19 at 23:58
  • the possible reason behind the cause will be if we have a precompiled website and within the root folder of it, we have another folder that has content for another asp.net application but isn't marked as an application in IIS. ASP.Net tracks asp.net applications when running on IIS by virtual directories in IIS marked as applications. A child folder having un-compiled content within a parent application that is precompiled will again cause this error. https://stackoverflow.com/questions/49868708/fix-for-system-web-httpexception-the-file-has-not-been-pre-compiled-and-cann – Jalpa Panchal Nov 27 '19 at 07:54

0 Answers0