今天遇到了这个问题,郁闷死了。唉。明明刚才程序运行的好好的。突然,出现了这个错误。
真不知道是怎么回事啊。还是互联网好,百度了一下,终于找到了解决方案。
本人使用方法2解决了我的问题。
错误信息提示如下:
编译器错误信息: CS0016:未能写入输出文件: '*:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\*\*.dll'--拒绝访问."
原因1:权限问题,访问权限问题。
解决方法1:为用户NETASP(NETWORK SERVICE [window 2003])设置windows下Temp文件夹的所有权限
解决方法2:
1、如果C:/Windows目录下没有Temp文件夹,则创建一个;
2、右键Temp文件夹--属性--安全,添加一个用户"NETWORK SERVICE ",(如果是.NET Framework 1.0 则添加用户"aspnet user"), "赋予权限--完全控制;
3、右击"我的电脑"-"属性"-"高级"-"环境变量",选择系统变量下的"TEMP",点编辑,设置变量值为 %SystemRoot%\TEMP,确定,再对"TMP"进行同样的操作,点击确定;
4、重启IIS服务,问题解决。
原因2:服务被某些优化软件禁止。
解决方案:
1、ASP.NET State Service被停止了,重新启动ASP.NET State Service服务,并设为自动。
2、开始-运行-iisreset;。
3、OK
编译器错误信息: CS0016:未能写入输出文件: '*:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\*\*.dll'--拒绝访问."
原因1:权限问题,访问权限问题。
解决方法1:为用户NETASP(NETWORK SERVICE [window 2003])设置windows下Temp文件夹的所有权限
解决方法2:
1、如果C:/Windows目录下没有Temp文件夹,则创建一个;
2、右键Temp文件夹--属性--安全,添加一个用户"NETWORK SERVICE ",(如果是.NET Framework 1.0 则添加用户"aspnet user"), "赋予权限--完全控制;
3、右击"我的电脑"-"属性"-"高级"-"环境变量",选择系统变量下的"TEMP",点编辑,设置变量值为 %SystemRoot%\TEMP,确定,再对"TMP"进行同样的操作,点击确定;
4、重启IIS服务,问题解决。
原因2:服务被某些优化软件禁止。
解决方案:
1、ASP.NET State Service被停止了,重新启动ASP.NET State Service服务,并设为自动。
2、开始-运行-iisreset;。
3、OK