An Asp.net website is created and used for membership authentication. When debugging and running in vs2010, everything works normally. However, when IIS (7.5) is used, the following error occurs:
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.
After some attempts, an effective solution is provided:
My website uses the default application pool (defaultapppool ).DefaultapppoolRight-click, selectAdvanced Settings..., In the pop-up windowProcess ModelInLoad user profileThe value is changedTrue. Restart the website service and run successfully.