“错误:cs0016无法写入输出文件...访问被拒绝”
如何解决以下错误?
错误:cs0016无法写入输出文件... c:\ Windows \ Microsoft Office.NET \ Framework64 \v4.0.30319 \Temporary ASP.NET Files \sitename\6c57f9d2 \bb09b49d\App_global.asax.5odzsyz5.dll'访问被拒绝
error: cs0016 could not write to output file...c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\sitename\6c57f9d2\bb09b49d\App_global.asax.5odzsyz5.dll' access is denied
我一直在努力解决这个问题。
在Web上找到一些涉及在错误消息中设置Temporary ASP.NET Files目录权限的解决方案。但即使打开Everyone也行不通。
I was struggling with this problem for a while. Found some solutions on the web that involved setting permissions on the "Temporary ASP.NET Files" directory in the error message. But even opening it up to "Everyone" didn't work.
然后最终通过以下步骤修复它:
Then eventually the following steps fixed it:
- 转到此网站的IIS AppPool
- 右键单击应用程序池并转到高级设置
- 将身份从ApplicationPoolIdentity更改为NetworkService
可能还有一些其他必要步骤,我在进行故障排除时执行了这些步骤,但是这样做了是关键的一步。出于某种原因,当Everyone为时,App Pool Identity(例如IIS_APPPOOL \SiteName)未被授予访问权限。我相信其他人可以解释为什么会出现这种情况......希望这有助于其他人解决这个令人沮丧的问题。
There may also be some other necessary steps, which I did while troubleshooting, but this is the key step. For some reason the App Pool Identity (such as IIS_APPPOOL\SiteName) isn't granted access when "Everyone" is. I'm sure someone else can shed some light on why this is the case... Hopefully this helps others resolve this frustrating issue.