IIS 6.0 and ASP.NET – Could not write to output file … The directory name is invalid

IIS 6.0 and ASP.NET – Could not write to output file … The directory name is invalid

回忆凄美了谁 发布于 2021-11-25 字数 1301 浏览 783 回复 10 原文

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:WINDOWSMicrosoft.NETFramework64v2.0.50727Temporary ASP.NET Filesroot7382c13fea9b3ff7App_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:WINDOWSMicrosoft.NETFramework64v2.0.50727Temporary ASP.NET Filesroot, then running iisreset
  • Resetting the permissions on c:WINDOWSMicrosoft.NETFramework64v2.0.50727Temporary ASP.NET Filesroot, then running iisreset
  • Resetting the permissions on c:WINDOWSTEMP, then running iisreset.

Any suggestions?


Other notes/responses:

  • The Indexing service is disabled.

如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

扫码加入群聊

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

十级心震 2022-06-07 10 楼

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:WINDOWSMicrosoft.NETFramework64v2.0.50727Temporary ASP.NET Filesroot7382c13fea9b3ff7App_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.

半衬遮猫 2022-06-07 9 楼

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:windowsmicrosoft.netframeworkv2.xxxASP.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.

落在眉间の轻吻 2022-06-07 8 楼

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.

故笙诉离歌 2022-06-07 7 楼

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

清晨说晚安 2022-06-07 6 楼

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.

路还长,别太狂 2022-06-07 5 楼

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:WINDOWSMicrosoft.NETFramework64v2.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:WINDOWSMicrosoft.NETFramework64v2.0.50727 folder (right-click, Properties, Security tab, Advanced, Owner tab)

北城半夏 2022-06-07 4 楼

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

七度光 2022-06-07 3 楼

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

森罗 2022-06-07 2 楼
  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.

雪花飘飘的天空 2022-06-07 1 楼

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=knowledgebaseANTS_ProfilerKB200903000362.htm