编译错误CS0016:无法写入到输出文件 [英] Compilation error CS0016: Could not write to output file

查看:211
本文介绍了编译错误CS0016:无法写入到输出文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在简介

当我尝试浏览我的网站,我得到了以下错误消息:

When I attempt to browse my website, I get the following error message:

CS0016:无法写入输出文件C:\\ WINDOWS \\ Microsoft.NET \\ Framework64 \\ V2.0.50727 \\临时ASP.NET文件\\ WWW \\ XXX \\ YYY \\ ZZZ \\ abdll - 目录名称无效的

CS0016: Could not write to output file 'c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\www\xxx\yyy\zzz\a.b.dll' - 'The directory name is invalid'

详情

我有我的开发PC上的两个web站点(假名):

I have two web-sites on my Development PC (fictitious names):


  • WEB2 - 这是在解决了一个集成模式2.0版的.NET框架和运行的程序池使用.NET 3.5和运行用ASP.NET。这是使用开发的Visual Studio 2010

  • WEB4 - 这是在解决了一个集成模式的V4.0 NET框架和运行的程序池使用.NET 4.5和运行用ASP.NET。这是使用Visual Studio 2012开发的。

  • Web2 - this is written in ASP.NET using .NET 3.5 and runs in an AppPool that addresses the v2.0 .NET framework and runs in an Integrated mode. This is developed using Visual Studio 2010
  • Web4 - this is written in ASP.NET using .NET 4.5 and runs in an AppPool that addresses the v4.0 .NET framework and runs in an Integrated mode. This is developed using Visual Studio 2012.

最近,我一直在VS2012工作WEB4几乎一直工作得很好,但是有一天,我试图运行web2的,得到了​​上面显示的除外。

Recently, I've been working in VS2012 on Web4 almost constantly and it works fine, however the other day I tried to run Web2 and got the exception displayed above.

奇怪的是,路径的一部分似乎指向一个德语的道路,因为它是\\脱DE \\(我用字母ZZZ上述代替) - 我不是在德国工作,所以我已经不知道在那里得到了这个想法。

Bizarrely, part of the path (which I replaced above with letters "zzz") appear to point to a German language path, since it's "\de-DE\" - I'm not operating in German, so I've no idea where it got this idea from.

一件事,几乎可以肯定是与联合国有关的,但不知什么原因,我觉得说是很重要的:我使用Visual Studio 2012中的性能分析工具的一天,这个问题第一次出现之前,我不知道这可能已经做出了一些改变,以我的电脑... ??

One thing that is almost certainly un-related, but for some unknown reason I feel it's important to mention: I was using the Performance Analysis tool in Visual Studio 2012 the day before this problem first appeared and I don't know if this might have made some changes to my computer...??

尝试修复

有关于这个在互联网上相当多的线程;某些线程结束的地方取得成功的文件访问权限已被修改,而其他人在做完一个有点绝望的冠冕堂皇的笔记...我已经通过我的电脑上与上一的同事比较所有相关的探测目录中的NTFS权限的历程本机仍在工作。不幸的是,没有快乐在那里了。

There are quite a few threads regarding this on the internet; some threads end in success where file access permissions have been altered whilst others finish on a somewhat desperate sounding note... I have gone through the process of comparing the NTFS permissions on all relevant sounding directories on my PC with that of a colleagues on whose machine this is still working. Unfortunately, no joy to be had there.

我也有未安装asp.net 2.0和重新安装使用它:

I have also un-installed asp.net 2.0 and re-installed it using:

C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -u
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -ir

和再次,没有快乐被要么不得不在那里。

and again, no joy to be had there either.

我WEB4继续运行不受影响。

My Web4 continues to run unaffected.

此外FYI:对Win7的X64使用的是IIS 7.5

Also FYI: using IIS 7.5 on Win7 x64.

我现在正在转向这种更广泛的观众把我目前的绝望状态为成功之一的希望。

I'm now turning to the this wider audience in the hope of turning my current state of despair into one of success.

谢谢大家。

格里夫

推荐答案

答案是使用procmon中找到:

The answer was found using ProcMon:

<一个href=\"http://technet.microsoft.com/en-us/sysinternals/bb896645\">http://technet.microsoft.com/en-us/sysinternals/bb896645

临时asp.net文件在用户的临时文件夹中第一次创建,然后转移到这个文件夹。对于一些尚未未知的原因,我WEB2网站(.NET 2程序池)编译现在使用相同的文件夹,我的WEB4(.NET 4的应用程序池)的网站。

The temporary asp.net files are first created in the user's temp folder and then moved into this folder. For some as yet unknown reason, the compilation for my Web2 site (.NET 2 AppPool) now uses the same folders as my Web4 (.NET 4 AppPool) site.

我曾经将procmon,以确定拒绝访问的所有结果,并给了IIS_IUSRS组的写权限(在一种情况下 - C:\\用户\\ ASP.NET V4.0集成 - 修改权限)。

I used ProcMon to identify all results for "access denied" and gave the IIS_IUSRS group write permissions (and in one case - C:\Users\ASP.NET V4.0 Integrated - modify permissions).

我不知道为什么编译使用的是错误的文件夹,我怀疑我可能在某些情况下,过度提升的权限,但现在它的工作。

I have no idea why the compilation is using the "wrong" folders and I suspect I may have over-elevated the permissions in some cases, but for now it's working.

这篇关于编译错误CS0016:无法写入到输出文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆