2011-09-16 169 views
3

我的Windows 7上有我的IIS 7.0的奇怪和无法解决的问题。
我尽我的本地测试服务器上运行的网站,并获得以下错误:IIS 7:身份'IIS APPPOOL DefaultAppPool'没有足够的权限来访问临时目录

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. 

我有几个游泳池,但其中只有一个工作正常。它是Classic .NET AppPool。在其他人的网站上运行我得到错误,这是前面提供的。最令人兴奋的是我无法通过IIS管理器的应用程序池找到池之间的任何配置差异。也许我错过了什么?
我试图更改Windows\TempC:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Fileslocal settings' temporary folder的访问权限,但我的操作没有效果。

因此,希望您的帮助和一些建议。

回答

2

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

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

而且我发现this forum topic

Another reason could be that the processModel in machine.config is set so that ASP.Net is running inside dllhost.exe instead of aspnet_wp.exe. If this is the case then you would need to give rights to IWAM_machineName account as well.

You can check the name of the process and account under with access denied error occurs by using FileMon utility from sysinternals.com.

0

另外一个值得考虑的选择...的默认应用的“C:\用户”下创建自己的用户帐户和文件夹的创建和首轮池时目录。它实际上是一个虚拟用户帐户,应该为应用程序池或“DefaultAppPool”命名。它使用此临时用户帐户来运行该池。在某些设置中,当访问IIs网站并使用默认池时,用户不会看到此文件夹,而是一个TEMP文件夹。此用户文件夹由池和ASP.NET用于缓存和写入II,ASP.NET和此虚拟帐户使用的文件资源和其他内容。

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

要修复它去到注册表中: HKEY_LOCAL_MACHINE \ SOFTWARE \微软\的Windows NT \ CURRENTVERSION \ ProfileList文件 查看是否有与名为“.bak”扩展为默认应用用户帐户的SID的用户帐户。如果这样删除并重新启动您的电脑。再次测试您的网站,确保其实际设置为使用DefaultAppPool。它现在应该重新创建用户中的“DefaultAppPool”文件夹,重新创建DefaultAppPool用户的注册表项,并且您的错误应该消失。即没有TEMP文件夹。

当我这样做后,我的所有堆栈溢出错误都在Visual Studio中为我的Web应用程序消失了,并且所有的应用程序池在IIs中重新启动并最终崩溃。

相关问题