Failed to generate a user instance of SQL Server due to failure in retrieving the user's local appli...

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

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local appli..._第1张图片

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。重启网站服务,运行成功。

 

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local appli..._第2张图片

转载于:https://www.cnblogs.com/zxppc/archive/2010/09/20/1831979.html

你可能感兴趣的:(Failed to generate a user instance of SQL Server due to failure in retrieving the user's local appli...)