This problem is driving me nuts.

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. '

I've tried to give full access to the network service on C:\windows\temp and the temp folder in v4.0.xxx folder.

The server is Windows Server 2008 R2; SQL Server 2008 R2 is installed on the same server.

I believe that it could have something to do with SQL Server being installed after the .NET Framework 4.0 was installed, but I ran aspnet_regiis.exe -u and then -i to reinstall. I've tried from both the Framework folder and Framework64 folder but to no avail.

Has anyone else had this problem? If so, how did you fix it?

link|improve this question
Does that directory actually exist (the whole path)? Try a complete clean and rebuild. – ChrisF Aug 19 '10 at 9:39
any anti-virus installed that could be interfering? – Jeff Atwood Aug 19 '10 at 11:32
feedback

2 Answers

One of the folder names in that path is invalid: Framework<64>. You can't use angle brackets in a folder name, since those symbols are used for redirecting input/output. Does that folder exist? Probably not. So something is trying to create and use that folder and failing with The directory name is invalid. Try looking at the configuration for whatever it is you're running that produces this error. Failing that, try searching the registry for that string and replace it with a more sensible folder name. Your best bet is to first identify which program is trying to use this path, uninstall it completely and reinstall it, making sure that it doesn't try to use an invalid folder name.

link|improve this answer
feedback
  1. Create a temporary folder under %Systemroot%, and then name it Temp.
  2. Grant full permissions on the Temp folder to the aspnet user account in .NET Framework 1.0 or to the NETWORK SERVICE user account in .NET Framework 1.1.
  3. Right-click My Computer, and then click Properties.
  4. On the Advanced tab, click Environment Variables.
  5. Select the TEMP variable under System variables, and then click Edit.
  6. Type %SystemRoot%\TEMP in the Variable Value box, and then click OK.
  7. Repeat steps 5 and 6 to edit the TMP variable. Click OK two times.
  8. Click Start, and then click Run.
  9. To reset Internet Information Services (IIS), type iisreset on the command prompt.
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.