Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path 解决(VS2010+IIS7.5)

建了一个asp.net网站,使用membership身份验证,在VS2010里调试运行时,一切正常,但是到了IIS(7.5)下,就出现了如下错误:

image

Server Error in '/me' Application.
--------------------------------------------------------------------------------

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.

 

经过一番尝试,现提供有效解决办法:

我的网站使用的是默认应用程序池(DefaultAppPool),在DefaultAppPool上右击,选Advanced Settings… , 在弹出窗口里面的Process Model项中,将Load User Profile的值改为True。重启网站服务,运行成功。

 

image

posted @ 2010-09-20 19:51  艾特时光  阅读(778)  评论(0编辑  收藏  举报