ASP.NET拒绝访问临时目录的解决方法

网络编程 2021-07-04 22:40www.168986.cn编程入门
这篇文章主要介绍了ASP.NET拒绝访问临时目录的解决方法,大家参考使用吧

今天把博客程序部署到一台阿里云Windows主机上,通过浏览器访问时出现狼蚁网站SEO优化的错误

代码如下:

创建 BlogConfigurationSettings 的配置节处理程序时出错: 拒绝访问临时目录。以其运行 XmlSerializer 的身份“IIS APPPOOL\.blogs.”没有足够的权限访问临时目录。CodeDom 将使用此进程用于进行编译的用户帐户,如果用户对系统临时目录没有访问权限,则将无法编译。使用 Path.GetTempPath() API 可找到临时目录位置。
Aess to the temp directory is denied.  Identity 'IIS APPPOOL\.blogs.' under which XmlSerializer is running does not have sufficient permission to aess the temp directory.  CodeDom will use the user aount the process is using to do the pilation, so if the user doesnt have aess to system temp directory, you will not be able to pile.  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,问题就解决。

Copyright © 2016-2025 www.168986.cn 狼蚁网络 版权所有 Power by