Web developers wiki ASP.NET Sitecore Sharepoint Kentico by Evident Interactive



When trying to open your web application, you get a yellow screen saying:

CS0016: Could not write to output file 'c:\Windows\Microsoft.NET\Framework<64>\vX.X.XXXX\Temporary ASP.NET Files\root\XXXXXX\XXXXXX\App_Web_XXXX.aspx.XXXXXXXX.XXXXXXXX.dll' -- 'The directory name is invalid. '



When compiling a web application's page on request, the compiler generally creates temporary file in your default TEMP (or TMP) directory. When the compiler has no access to this directory, the error will occur.

So, this has nothing to do with the directory displayed in the error message.



To solve this issue take the following steps:

1. Find out what TEMP directory the compiler is trying to write to
2. Grant the user the compiler uses full access to this folder


What TEMP directory am I using

Watch out: besides the use of a globally defined TEMP (or TMP) system variable, there can also be a user variable for the temp directory!


Method 1

Press (WINDOWS) + (PAUSE/BREAK) on your keyboard and go to Advanced system settings. Now check (in both lists!) for a variable named TEMP and TMP. This is the folder you should grant access to.


Method 2

Open a command prompt en type 'set' followed by (ENTER). The variables TEMP and/of TMP represent your temp folder.


Grant the user access

Grant the following user full control over the temp directory

When using IIS 5: ASPNET When using IIS 6 or IIS 7: NETWORK SERVICE

Or IUSR_MACHINENAME when impersonating.

 © Evident Interactive BV