IIS 6.0 and ASP.NET - Could not write to output file ... The directory name is invalid
Asked Answered
T

10

9

I'm running IIS 6.0 on Windows 2003 and started getting this error:

Compiler Error Message: CS0016: Could not write to output file 'c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\7382c13f\ea9b3ff7\App_global.asax.zodyof_q.dll' -- 'The directory name is invalid. '

I've checked all the permissions, and everything is as it needs to be - plus, the error message doesn't mention permissions. I've tried the following already:

  • Following the instructions from this [outdated] KB article: http://support.microsoft.com/kb/825791/en-us
  • Repairing the .NET Framework v3.5 installation, then rebooting
  • Deleting the contents of c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root, then running iisreset
  • Resetting the permissions on c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root, then running iisreset
  • Resetting the permissions on c:\WINDOWS\TEMP, then running iisreset.

Any suggestions?


Other notes/responses:

  • The Indexing service is disabled.
Table answered 27/4, 2009 at 16:41 Comment(4)
How is that file name obtained?Adinaadine
Not sure I follow - I copied it from the resulting error page if that's what you mean.Table
This answer over on superuser fixed the issue for me: superuser.com/a/638462/98557Nineteen
support.microsoft.com/en-us/kb/825791 has worked for me.Urticaria
F
4

I've found an answer that is applicable if you've installed ANTS profiler and it crashed while profiling. This KB Article describes one of the solutions:

http://www.red-gate.com/supportcenter/Content.aspx?p=ANTS%20Profiler&c=knowledgebase\ANTS_Profiler\KB200903000362.htm

Fastness answered 12/5, 2009 at 20:55 Comment(0)
A
3
  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.

To reset Internet Information Services (IIS), type iisreset on the command prompt.

Ahmedahmedabad answered 30/11, 2011 at 9:20 Comment(0)
N
2

Use SysInternals FileMon (or ProcMon if you like) to see the real file it is bitching about. You can restrict it to just monitoring IIS if you have a busy server, although I'd start with all processes and just capture a couple of seconds of output.

Before running, ensure IIS has been reset using iisreset /restart so that the error is not cached from before.

Ryan

Nucleotidase answered 27/4, 2009 at 16:45 Comment(0)
D
2

I had the same error running IIS 7.0 / Vista Ultimate / .NET 2.0 Web App. I tried setting "Full Control" permissions on temporary folder for NETWORK SERVICE user (right-click on folder c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727, Properties, Security tab) and turning off antivirus and UAC, but it didn't help.

But this worked as magic: Open IIS Manager -> Select "View Application Pools" from right menu -> Select "Advanced Settings" -> Set your username (and password) in "Identity" property -> Restart IIS

If this doesn't work, check additionally that you're an owner of c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727 folder (right-click, Properties, Security tab, Advanced, Owner tab)

Demakis answered 10/10, 2009 at 9:54 Comment(0)
R
2

To every body who still has the problem! Mine is solved by the followings http://support.microsoft.com/kb/825791

Reinaldo answered 7/4, 2011 at 0:33 Comment(0)
L
1

OK, when you repaired the installation do you mean ASPNET_REGIIS -u / ASPNET_REGIIS -i ? that would fix disk permissions.

It might be your virusscanner; exclude your .net temporary folders / inetpub if you can and if its safe.

Lukelukens answered 27/4, 2009 at 16:58 Comment(0)
W
0

Have to tried disabling windows Indexing Service for the temporary asp.net files folder

Wendolynwendt answered 27/4, 2009 at 16:46 Comment(0)
D
0

I received the same error. The anti-virus/security software (McAffee Viruscan Enterprise) was preventing visual studio tool csc.exe to dynamically compile code and create the entity data model dll in the directory folder above which falls under the windows directory folder. There is a section in McAffee called access protection that has a rule called Maximum Protection that prohibits creating executable files in the windows directory folder. Simply temporary disable the rule or access protection to compile the website successfully.

Drambuie answered 5/6, 2009 at 20:25 Comment(0)
O
0

Here is the final solution :)


  1. First give all the permission to ASPNET account , NETWORK SERVICE account to "ASP.NET Temporary files" folder under whichever the framework it is using.
    like C:\windows\microsoft.net\framework\v2.xxx\ASP.NET Temporary files.

  2. Check the temporary folder configured for your machine under environment variables for TEMP and TEMP. For that folder also give all the permission to ASPNET account , NETWORK SERVICE accout. Reset the IIS It should be working fine.

Ogdon answered 12/8, 2010 at 14:36 Comment(0)
K
0

From windows server 2003 x64 , IIS6 , net 4.0 , asp application I was presented with the error:

Compiler Error Message: CS0016: Could not write to output file 'c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\7382c13f\ea9b3ff7\App_global.asax.zodyof_q.dll' -- 'The directory name is invalid. '

It was resolved when I created the DIR

d:\temp

No idea why D:\temp was important but I will update this answer with a reason as soon as I know.

Permissions on the DIR were:

admin full

creator owner special

system full

users read&execute / list / read

No IIS specific user permission was defined.

Working to migrate to IIS7 host but thought this answer maybe helpful for someone.

Kinematics answered 18/8, 2015 at 15:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.