今天把部落格程式部署到一台阿里雲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,問題就解決。
![]()