天天看点

编译器错误信息: CS0016: 未能写入输出文件 错误处理

编译错误

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

编译器错误信息: 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.

继续阅读