程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> .NET網頁編程 >> ASP.NET >> ASP.NET基礎 >> ASP.NET拒絕訪問臨時目錄的解決方法

ASP.NET拒絕訪問臨時目錄的解決方法

編輯:ASP.NET基礎

今天把博客程序部署到一台阿裡雲Windows主機上,通過浏覽器訪問時出現下面的錯誤:
復制代碼 代碼如下:
創建 BlogConfigurationSettings 的配置節處理程序時出錯: 拒絕訪問臨時目錄。以其運行 XmlSerializer 的身份“IIS APPPOOL\www.cnblogs.com”沒有足夠的權限訪問臨時目錄。CodeDom 將使用此進程用於進行編譯的用戶帳戶,因此如果用戶對系統臨時目錄沒有訪問權限,則將無法編譯。使用 Path.GetTempPath() API 可找到臨時目錄位置。
Access to the temp directory is denied.  Identity 'IIS APPPOOL\www.cnblogs.com' under which XmlSerializer is running does not have sufficient permission to access the temp directory.  CodeDom will use the user account the process is using to do the compilation, so if the user doesnt have access to system temp directory, you will not be able to compile.  Use Path.GetTempPath() API to find out the temp directory location.
CS0016: 未能寫入輸出文件“c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\946055b8\92eead15\App_global.asax.qakaesxx.dll”--“拒絕訪問。 ”

開始以為是“C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files”文件夾權限的問題,但怎麼設置這個權限也解決不了問題。

後來在應用程序池設置中將“加載用戶配置文件”(Load User Profile)設置為true,問題就解決。

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved