var competitive=new {technique,business}

2007/4/22

server2003+ii6 编译器错误信息:CS0016: 未能写入输出文件解决方案


安装Quick Start后出现错误CS0016,解决方法:
1,重新安装试试。
2,修改windows\temp或Temporary ASP.NET Files文件夹的权限使net services具有写入修改权限。
转:

解 决:编译器错误信息: CS0016: 未能写入输出文件“c:WINDOWSMicrosoft.NETFrameworkv1.1.4322Temporary ASP.NET Fileslistenleaksae3daa38e9fdb67zaie9ij.dll”--“拒绝访问。 ”

一、http://support.microsoft.com/default.aspx?scid=kb;en-us;329065#

PRB: Access Denied Error When You Make Code Modifications with Index Services Running

RESOLUTION

If you do not use Index Server on the server, you can disable it. To do so, follow these steps:
1. Click Start, and then click Services.
2. Locate Indexing Service from the list of services, and then click Indexing Service Properties from the subform.
3. On the General tab of the Indexing Service Properties dialog box, in the Startup type drop-down item list, click Disabled.
4. Click OK.

If you use Index Server, you can exclude the Temporary ASP.NET Files directory from the folders that the Index Server scans. To do so, follow these steps:
1. Click Start, point to All Programs, point to Administrative Tools, and then click Computer Management.
2. Expand the Services and Applications node, expand the Indexing Service node, and then expand the System node.
3. Right-click the Directories folder, point to New, and then click Directory from the subform to open the Add Directory dialog box.
4. Click Browse, and then locate the Temporary ASP.NET Files directory. You typically find the Temporary ASP.NET files in the following path: c:Microsoft.NETFrameworkTemporary ASP.NET Files
Note is the version of .NET Framework installed on your computer.
5. Click No under the Include in Index? option buttons.
6. Click OK to close.
7. Close the Computer Management dialog box.
8.

Restart the Indexing Services service.

二、

另 外还有一个 Access denied 的错误说是不能访问 C:WINDOWSMicrosoft.NETFrameworkv1.1.4322Temporary ASP.NET Files 下的某个目录。产生这些错误的原因很多,主要的可能包括:Bin 目录或者 Web.config 被更改以及访问文件系统的权限不够。

如果 Bin 目录或者 Web.config 被更改,MSDN 网站上有文章说是因为 Microsoft Index Services(Indexing Service) 服务在运行。详细内容可以访问: PRB: Access Denied Error When You Make Code Modifications with Index Services Running

但是另外还需要注意一些别的问题,

  • 检查 Bin 目录的文件系统访问权限。一般只要确保 Users 容器拥有“读取和运行”、“列出文件夹目录”和“读取”的权限就可以了。
  • 如 果提示说不能访问 C:WINDOWSMicrosoft.NETFrameworkv1.1.4322Temporary ASP.NET Files... ,可以将 Temporary ASP.NET Files 目录的访问权限列表中添加 Everyone,并设置为拥有所有的权限。然后在访问一次此 Web 应用程序后,将 Temporary ASP.NET Files 目录的访问权限列表中将 Everyone 删除就可以了。

综上所述的方法,主要包括:

  • 禁用或设置 Indexing Service 服务;
  • 检查 Bin 目录的访问权限;
  • 设置 Temporary ASP.NET Files 目录的访问权限。

三、在 Windows2003 下(IIS6),用 VS2003 生成一个 asp.net 应用,然后 F5 进行调试,出现如下错误信息:

“/0124”应用程序中的服务器错误。

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

编 译器错误信息: CS0016: 未能写入输出文件“e:WINDOWSMicrosoft.NETFrameworkv1.1.4322Temporary ASP.NET Files124fea90a4b69167562pw09que0.dll”--“拒绝访问。 ”
源错误:版本信息: Microsoft .NET Framework 版本:1.1.4322.2032; ASP.NET 版本:1.1.4322.2032

我于是用“WINDOWSMicrosoft.NETFrameworkv1.1.4322Temporary ASP.NET Files”在msdn以及网上搜了一把,搜到两种解决方案:

修改该目录的权限,加上“NETWORK SERVICE”,让它对该目录有控制权限。
修改IIS服务的缺省账户为“本地系统”
经验证,方法二可行,方法一失败。(yzt_andyamy采用方法一却成功了!)但是方法二会导致IIS运行不安全,所以这种方法不太合适。

后来我查看了别人的配置,发现人家IIS服务的缺省账户都是“网络服务”,这就说明我的机器的权限设置在某个地方存在差异。但是问题出在哪里呢?我遍查MSDN和Google/baidu也没有找到答案。

后来不知道抽了哪根筋,灵光一闪,看看 WindowsTemp 的权限设置,把 “NETWORK SERVICE”的权限设置为“控制”级别,再试试Debug,成了!

真是见鬼!难道说这是Windows的一个BUG?还是我的哪个地方的设置出现了问题?

==上面是一个GG的BLOG,偶按照他的方法,设置了 WindowsTemp 的权限,结果好了。
莫名其妙。

0 评论: