I've been battling for two days tracking down a mysterious error when compiling an ASP.NET website. The error is the (quite famous) CS0016: "Unable to write to output file [filename] - directory is invalid".
I have discovered after two days of debugging that the cause of my problem is that the NetworkService somehow does not have the necessary rights to C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files. I have added "Everyone" with full rights to the folder - but I am still unable to access http://localhost and I can see using Process Monitor from SysInternals that the NetworkService account gets a "NAME NOT FOUND" when trying to create a DLL-file in that directory. My interpretation is that it does not have sufficient rights to the folder somehow.
However - when I fire up Visual Studio and attach a debugger the files are compiled using my domain user (JohnDoe for reference) and for some reason that works out fine - as if the domain user account contains further rights than I am unable to give the local users on my machine - which puzzles me a lot.
My two question to you guys are: Why is it that when I add "Everyone" with full rights to a folder the NetworkService still does not have the rights neccessary to create the temporary files needed? And which rights does my JohnDoe domain user have which I am unable to grant my local users on my machine?