华域联盟 .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,问题就解决。

您可能感兴趣的文章:

  • asp.net中WebResponse 跨域访问实例代码
  • ASP.net中网站访问量统计方法代码
  • asp.net 未能写入输出文件--“拒绝访问的解决办法
  • ASP.NET对路径"xxxxx"的访问被拒绝的解决方法小结
  • ASP.NET MVC3关于生成纯静态后如何不再走路由直接访问静态页面
  • asp.net 实现静态页面累加访问量的三种方式
  • ASP.NET数据库编程之处理文件访问许可
  • asp.net实现访问局域网共享目录下文件的解决方法

本文由 华域联盟 原创撰写:华域联盟 » ASP.NET拒绝访问临时目录的解决方法

转载请保留出处和原文链接:https://www.cnhackhy.com/52676.htm

本文来自网络,不代表华域联盟立场,转载请注明出处。

作者: sterben

发表回复

联系我们

联系我们

2551209778

在线咨询: QQ交谈

邮箱: [email protected]

工作时间:周一至周五,9:00-17:30,节假日休息

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部