简体   繁体   English

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

[英]IIS 7: Identity 'IIS APPPOOL\DefaultAppPool' does not have sufficient permission to access the temp directory

I have strange and unresolvable problem with my IIS 7.0 on Windows7. 我在Windows7上使用IIS 7.0时遇到了奇怪且无法解决的问题。
I try run site on my local test server and get following error: 我尝试在我的本地测试服务器上运行站点并获得以下错误:

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.

I have several pools, but only one among them works correctly. 我有几个池,但只有一个池正常工作。 It's Classic .NET AppPool . 它是Classic .NET AppPool Running sites on other ones I get error, which was provided earlier. 在其他网站上运行网站我得到错误,这是之前提供的。 The most intresting is I cann't find any differents between pools' configuration through Application Pools of IIS Manager. 最有趣的是我在IIS管理器的应用程序池中找不到池配置之间的任何差异。 Maybe I am missing something? 也许我错过了什么?
I tried to change access rights for Windows\\Temp , C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\Temporary ASP.NET Files , and local settings' temporary folder , but my actions did not have effects. 我试图更改Windows\\TempC:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\Temporary ASP.NET Fileslocal settings' temporary folder访问权限,但我的操作没有效果。

So, hope for your help and some advices. 所以,希望得到你的帮助和一些建议。

Did you call the Path.GetTempPath() method (you can call this method from every program, not necessary from your website)? 您是否调用了Path.GetTempPath()方法(您可以从每个程序调用此方法,而不是从您的网站调用)?

You must set full access to this path for your account. 您必须为帐户设置此路径的完全访问权限。

Also I found 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. 另一个原因可能是设置了machine.config中的processModel,以便ASP.Net在dllhost.exe而不是aspnet_wp.exe中运行。 If this is the case then you would need to give rights to IWAM_machineName account as well. 如果是这种情况,那么您还需要为IWAM_machineName帐户授予权限。

You can check the name of the process and account under with access denied error occurs by using FileMon utility from sysinternals.com. 您可以使用sysinternals.com中的FileMon实用程序检查进程和帐户的名称,并显示访问被拒绝错误。

One other option to consider...the DefaultAppPool creates its own user account and folder under the "c:\\Users" directory when the pool is created and first run. 另一个需要考虑的选项......当创建并首次运行池时,DefaultAppPool会在“c:\\ Users”目录下创建自己的用户帐户和文件夹。 Its actually a virtual user account and should be named for the Application Pool, or "DefaultAppPool". 它实际上是一个虚拟用户帐户,应该以应用程序池或“DefaultAppPool”命名。 It uses this temporary user account to run the pool. 它使用此临时用户帐户来运行池。 In some setups people are not seeing this folder but a TEMP folder when the IIs web site is accessed and using the Default pool. 在某些设置中,当访问IIs网站并使用默认池时,人们看不到此文件夹而是TEMP文件夹。 This User folder is used by the pool and ASP.NET for caching and writing of file resources and other things used by IIs, ASP.NET, and this virtual account. 池和ASP.NET使用此User文件夹来缓存和写入文件资源以及IIs,ASP.NET和此虚拟帐户使用的其他内容。

If you instead see a "TEMP" folder in the Users folder you have a broken application pool account in IIs and in the Registry. 如果您在“用户”文件夹中看到“TEMP”文件夹,则表明IIs和注册表中的应用程序池帐户已损坏。 The pool is creating the TEMP folder as a backup for this virtual account, which might not have the right security setup. 池正在创建TEMP文件夹作为此虚拟帐户的备份,该虚拟帐户可能没有正确的安全设置。 I had this exact scenario. 我有这个确切的场景。

To fix it go to the registry under: HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList See if you have a SID user account with the ".bak" extension for a DefaultAppPool user account. 要解决此问题,请转到以下注册表:HKEY_LOCAL_MACHINE \\ SOFTWARE \\ Microsoft \\ Windows NT \\ CurrentVersion \\ ProfileList查看您是否拥有DefaultAppPool用户帐户的扩展名为“.bak”的SID用户帐户。 If so delete it and restart your PC. 如果有,请删除它并重新启动电脑。 Test your website again, making sure its actually setup to use DefaultAppPool. 再次测试您的网站,确保其实际设置为使用DefaultAppPool。 It should now recreate the "DefaultAppPool" folder in Users, recreate the registry entry for DefaultAppPool user, and your error should go away. 它现在应该在Users中重新创建“DefaultAppPool”文件夹,重新创建DefaultAppPool用户的注册表项,并且您的错误应该消失。 ie no TEMP folder. 即没有TEMP文件夹。

After I did this, all my stack overflow errors went away in Visual Studio for my web application and all the restarting and final crash of the Application Pool in IIs. 在我这样做之后,我的Web应用程序的Visual Studio中的所有堆栈溢出错误以及IIs中应用程序池的所有重新启动和最终崩溃都消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2013.您没有足够的权限访问计算机上的IIS网站 - Visual Studio 2013. You do not have sufficient privilege to access IIS web sites on your machine 标准的AppPool身份怎么有权限弹出调试器window - How can the standard AppPool identity have permission to pop up a debugger window 为什么IIS似乎将AppPool的一个请求的WindowsIdentity提升到我的用户帐户? - Why does IIS seem to be elevating the WindowsIdentity of one request from the AppPool to my user account? IIS 应用程序池身份对隔离存储的权限,无需更改 iis 身份验证方法 - IIS application pool identity permission to isolated storage without changing iis auth method IIS应用程序池访问网络上的远程目录 - IIS application pool access to remote directory on network 向IIS应用程序分配权限 - Assigning permission to an IIS application 如何确保IIS_IUSR组对c:\\ windows \\ temp文件夹具有特殊权限? - How to ensure that IIS_IUSR group has special permission to c:\windows\temp folder? IIS 为我的 AppPool 使用哪个版本的 .NET Framework? - Which version of the .NET Framework is IIS using for my AppPool? 从SQL Server作业调用IIS AppPool(2005) - Calling IIS AppPool from SQL Server Job (2005) IIS AppPool配置为使用.NET Framework 4.0仍在使用2.0 - IIS AppPool configured to use .NET Framework 4.0 is still using 2.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM