玄铁剑

成功的途径:抄,创造,研究,发明...
posts - 128, comments - 42, trackbacks - 0, articles - 174

ASP.NET程序运行时只读/权限问题

Posted on 2008-12-22 20:26 玄铁剑 阅读(429) 评论(0)  编辑 收藏 引用 所属分类: asp.net

CS0016: Could not write to output file 'c:WINDOWSMicrosoft.NETFrameworkv1.1.4322Temporary ASP.NET Filesapplication1c11b43f6cf3ec03
izcntet.dll' . The directory name is invalid. SYMPTOMS
When you view a Microsoft ASP.NET Application in a Web browser, you may receive the following error messages:

For the Microsoft .NET Framework version 1.1, the error message is the following:

CS0016: Could not write to output file 'c:WINDOWSMicrosoft.NETFrameworkv1.1.4322Temporary ASP.NET Filesapplication1c11b43f6cf3ec03
izcntet.dll' . The directory name is invalid.
For the .NET Framework 1.0, the error message is the following:

CS0013: Unexpected error writing metadata to file 'C:WINDOWSMicrosoft.NETFrameworkv1.0.3705Temporary ASP.NET Filesapplication23fc72f26eb731247ev2bslce.dll'. The directory name is invalid.
-------------------------------------------------------------------------------------------------

CAUSE
The system TEMP and TMP variables point to a folder that does not exist. The compiler generates temporary files in the folder where the TEMP and the TMP variables point to before the files are copied to the Temporary ASP.NET Files folder. However, the folder where the system variables point to is deleted when you restart the computer. Therefore, the compiler cannot generate the temporary files.
-------------------------------------------------------------------------------------------

RESOLUTION
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

只有注册用户登录后才能发表评论。