天天看點

.NET 部署到 IIS 權限級别的問題 ‘ / ’Compiler Error Message: CS0016: Could not write to output file 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\xxx' -- 'Access is denied. '

Compiler Error Message: CS0016: Could not write to output file 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\xxx' -- 'Access is denied. '

今天在阿裡雲虛拟機上部署新站點後出現下面的錯誤:

Compiler Error Message: CS0016: Could not write to output file 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\xx' -- 'Access is denied. '      

找遍了網上的資料最後總結為以下幾步::

  • Cleaned the "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files" folder
  • Gave Full permissions to IIS_IUSRS group
  • Gave Full permissions to "Everone"
  • Ran the following command too: %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis -i

郁悶的是都沒能解決我的問題,最後給 "C:\Windows\Temp"檔案夾加上 IIS_IUSRS的權限就好了。

原文:

繼續閱讀