Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net IIS 7:标识';IIS APPPOOL\DefaultAppPool';没有足够的权限访问临时目录_.net_Asp.net_Iis_Windows 7_Iis 7 - Fatal编程技术网

.net IIS 7:标识';IIS APPPOOL\DefaultAppPool';没有足够的权限访问临时目录

.net IIS 7:标识';IIS APPPOOL\DefaultAppPool';没有足够的权限访问临时目录,.net,asp.net,iis,windows-7,iis-7,.net,Asp.net,Iis,Windows 7,Iis 7,我在Windows7上的IIS 7.0出现了一个奇怪且无法解决的问题。 我尝试在本地测试服务器上运行站点,但出现以下错误: Access to the temp directory is denied. Identity 'IIS APPPOOL\DefaultAppPool' under which XmlSerializer is running does not have sufficient permission to access the temp directory.

我在Windows7上的IIS 7.0出现了一个奇怪且无法解决的问题。
我尝试在本地测试服务器上运行站点,但出现以下错误:

Access to the temp directory is denied.  
Identity 'IIS APPPOOL\DefaultAppPool' 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 doesn't have access to system temp directory,  
you will not be able to compile.  
Use Path.GetTempPath() API to find out the temp directory location.
我有几个游泳池,但其中只有一个能正常工作。这是经典的.NETAppPool。在其他站点上运行站点时,我会收到前面提供的错误。最有趣的是,我无法通过IIS管理器的应用程序池找到池配置之间的任何差异。也许我错过了什么?
我试图更改
Windows\Temp
C:\Windows\Microsoft.NET\Framework\v4.0.30319\ASP.NET临时文件
,以及
local settings'临时文件夹
,但我的操作没有效果


因此,希望您能提供帮助和建议。

您是否调用了
Path.GetTempPath()
方法(您可以从每个程序调用此方法,而不是从您的网站调用)

您必须为您的帐户设置对此路径的完全访问权限

我还发现:

另一个原因可能是machine.config中的processModel已设置 因此ASP.Net在dllhost.exe中运行,而不是在 aspnet_wp.exe。如果是这种情况,那么你需要给予权利 到IWAM_machineName帐户

您可以使用access在下检查进程和帐户的名称 使用sysinternals.com中的FileMon实用程序发生拒绝错误


另一个选择……Debug TopCub在创建并首次运行池时,在“C:\用户”目录下创建自己的用户帐户和文件夹。它实际上是一个虚拟用户帐户,应该以应用程序池或“DefaultAppPool”命名。它使用此临时用户帐户运行池。在某些设置中,当访问IIs网站并使用默认池时,人们看到的不是此文件夹,而是临时文件夹。池和ASP.NET使用此用户文件夹缓存和写入文件资源以及IIs、ASP.NET和此虚拟帐户使用的其他内容

如果在Users文件夹中看到“TEMP”文件夹,则IIs和注册表中的应用程序池帐户已损坏。池正在创建临时文件夹作为此虚拟帐户的备份,该虚拟帐户可能没有正确的安全设置。我有一个确切的场景

要修复此问题,请转到以下注册表: HKEY\U LOCAL\U MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList 查看是否有DefaultAppPool用户帐户扩展名为“.bak”的SID用户帐户。如果是这样,请删除它并重新启动您的电脑。再次测试您的网站,确保其实际设置为使用DefaultAppPool。它现在应该在Users中重新创建“DefaultAppPool”文件夹,为DefaultAppPool用户重新创建注册表项,您的错误就会消失。没有临时文件夹


完成此操作后,我的web应用程序的Visual Studio中的所有堆栈溢出错误以及IIs中应用程序池的所有重新启动和最终崩溃都消失了。

也可以在C:\Users下看到名为“TEMP.IIs APPPOOL”的文件夹。删除属于IIS用户帐户的HKEY\U LOCAL\U MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList下的密钥并重新启动修复了它!