Everything was working perfectly and then suddenly during ASP.NET (MVC) development you got this error from your IIS 7 server (in our case from Windows 7 64-bit):
Compiler Error Message: CS0016: Could not write to output file ‘c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\myapp\xxxxx\xxxxx\App_GlobalResources.xxxxxxx.dll’ — ‘Access is denied.’
So, what goes wrong? You don’t know because it was working perfectly previous day, it is also compiles OK but not working anymore on your IIS webserver and, all you got, is yellow screen with this error message.
We searched a little bit and found that the problem appeared because the permission were lost on following Temporary folders:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\
C:\Windows\Temp
Recipe
- Gave a full permission to NETWORK SERVICE user to these folders (extreme case is to give full permission to Everyone user to these folders – do this only it doesn’t work)
- Restart IIS using iisreset command
IIS started to serve pages again….
