今天把博客程序部署到一臺(tái)阿里云Windows主機(jī)上,通過瀏覽器訪問時(shí)出現(xiàn)下面的錯(cuò)誤:
復(fù)制代碼 代碼如下:
創(chuàng)建 BlogConfigurationSettings 的配置節(jié)處理程序時(shí)出錯(cuò): 拒絕訪問臨時(shí)目錄。以其運(yùn)行 XmlSerializer 的身份“IIS APPPOOL\www.cnblogs.com”沒有足夠的權(quán)限訪問臨時(shí)目錄。CodeDom 將使用此進(jìn)程用于進(jìn)行編譯的用戶帳戶,因此如果用戶對(duì)系統(tǒng)臨時(shí)目錄沒有訪問權(quán)限,則將無法編譯。使用 Path.GetTempPath() API 可找到臨時(shí)目錄位置。
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”文件夾權(quán)限的問題,但怎么設(shè)置這個(gè)權(quán)限也解決不了問題。
后來在應(yīng)用程序池設(shè)置中將“加載用戶配置文件”(Load User Profile)設(shè)置為true,問題就解決。
![](/d/20211017/8a94cd3add858364ed2af92e3c7b298d.gif)
您可能感興趣的文章:- asp.net中WebResponse 跨域訪問實(shí)例代碼
- ASP.net中網(wǎng)站訪問量統(tǒng)計(jì)方法代碼
- asp.net 未能寫入輸出文件--“拒絕訪問的解決辦法
- ASP.NET對(duì)路徑"xxxxx"的訪問被拒絕的解決方法小結(jié)
- ASP.NET MVC3關(guān)于生成純靜態(tài)后如何不再走路由直接訪問靜態(tài)頁面
- asp.net 實(shí)現(xiàn)靜態(tài)頁面累加訪問量的三種方式
- ASP.NET數(shù)據(jù)庫編程之處理文件訪問許可
- asp.net實(shí)現(xiàn)訪問局域網(wǎng)共享目錄下文件的解決方法