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

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

问题描述

简介

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

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

CS0016:无法写入输出文件 'c:WindowsMicrosoft.NETFramework64v2.0.50727Temporary ASP.NET Fileswwwxxxyyyzzzabdll' - '目录名称是无效'

CS0016: Could not write to output file 'c:WindowsMicrosoft.NETFramework64v2.0.50727Temporary ASP.NET Fileswwwxxxyyyzzza.b.dll' - 'The directory name is invalid'

详细

我的开发 PC 上有两个网站(虚构名称):

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

  • Web2 - 这是使用 .NET 3.5 在 ASP.NET 中编写的,并在解决 v2.0 .NET 框架并以集成模式运行的 AppPool 中运行.这是使用 Visual Studio 2010 开发的
  • Web4 - 这是使用 .NET 4.5 在 ASP.NET 中编写的,并在解决 v4.0 .NET 框架的 AppPool 中运行并以集成模式运行.这是使用 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.

最近,我几乎一直在 Web4 上使用 VS2012 并且它工作正常,但是前几天我尝试运行 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.

奇怪的是,路径的一部分(我在上面用字母zzz"替换了它)似乎指向德语路径,因为它是de-DE"——我不是用德语操作的,所以我我不知道它从哪里得到这个想法.

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...??

尝试修复

互联网上有很多关于此的主题;一些线程以成功结束,其中文件访问权限已被更改,而其他线程以有点绝望的声音结束...机器这还在工作.不幸的是,那里没有快乐.

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:WindowsMicrosoft.NETFramework64v2.0.50727aspnet_regiis.exe -u
C:WindowsMicrosoft.NETFramework64v2.0.50727aspnet_regiis.exe -ir

再说一次,那里也没有快乐.

and again, no joy to be had there either.

我的 Web4 继续运行,不受影响.

My Web4 continues to run unaffected.

另外仅供参考:在 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:

http://technet.microsoft.com/en-us/sysinternals/bb896645 >

临时 asp.net 文件首先在用户的临时文件夹中创建,然后移动到此文件夹中.由于某些未知的原因,我的 Web2 站点 (.NET 2 AppPool) 的编译现在使用与我的 Web4 (.NET 4 AppPool) 站点相同的文件夹.

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:UsersASP.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:UsersASP.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天全站免登陆