编译错误
说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。

编译器错误信息: CS0016: 未能写入输出文件“d:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/5177u/d087da43/c12930d8/9ze28k_8.dll”--“拒绝访问。 ”

源错误:

 
 

源文件:    行: 0

解决办法:

  前几天碰到这个问题,试过很多方法,比如:停止索引服务,重装IIS,重装.Net Framework,删除

Temporary ASP.NET Files目录再重赋权限,甚至重装系统,问题依旧;

网上搜了一下,很多人碰到这个问题想到的都是给Temporary ASP.NET Files目录赋权限,我开始

也是这样,最后在微软的网站搜到了这个问题的解决方法,其实很简单,只要在windows/temp权限设置里

面把Network service(如果是win2000则是asp.net用户)的权限加上就行

MSDN给出的解释如下:

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:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/application1/c11b43f6/cf3ec03/rizcntet.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:/WINDOWS/Microsoft.NET/Framework/v1.0.3705/Temporary ASP.NET Files/application2/3fc72f26/eb731247/ev2bslce.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.

Note If the error message that is mentioned in the "Symptoms" section of this article persists, restart the computer.