We're experiencing an issue with ASP.Net runtime compilation.
At the start (and after restarts) of the IIS, user controls and layouts compile just fine without any problem. But at some point during the lifecycle, the runtime compilation simply stops working. A restart of the IIS process makes it work again.
After searching through a myriad of different posts, we've done some extra debugging, but we are still stumped as to what causes our problem.
To keep this to the point, I'll skip explaining all tests we have done, and jump right to what I believe is closest to the heart of the error.
We have switched our compilation.tempDirectory to a custom folder used exclusively by this web application, and we have set a procmon to see all file changes in this folder. Once the error starts occuring we can see that the temporary files are actually written to this drive, and csc.exe is started (and during this, conhost.exe, CcmExec.exe and many other processes), we see no errors in procmon, but after csc.exe has run, it deletes the temporary files without leaving the compiled versions. (and the asp.net error screen shows us csc.exe failed, but not exactly what failed). The temporary files are all created (except for the resulting dll) - .0.cs, .1.cs, .tmp, .cmdline, .out, .err are all there for a short time. But immediatly after creation, they're all deleted again, and the application cannot find them.
Does anyone have any clue as to what causes this to fail after the process has run for a while? The exact same file compiles just fine if we run it just after an IIS restart, but after a while it seems that something during the runtime compilation fails, causing the ASP/w3wp/csc process to delete all signs of the temporary files, not creating the dll, and making the functionality fail.