由于无法检索用户的本地应用程序数据路径,无法生成SQL Server的用户实例。

时间:2014-01-23 08:08:33

标签: local

应用程序中的服务器错误。

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.

Source Error: 


Line 54:             if (_con.State == ConnectionState.Closed)
Line 55:             {
Line 56:                 _con.Open();
Line 57:             }
Line 58:         }

Source File: D:\kuwait\21JAN2014\kuwait_ON_26-2-2013\WebMediSmart\AdminPages\HospitalMaster.aspx.cs    Line: 56 

Stack Trace: 


[SqlException (0x80131904): 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.]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5009598
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275
   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +183
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +239
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +5023255
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +524
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +479
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +108
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
   System.Data.SqlClient.SqlConnection.Open() +125
   WebMediSmart.AdminPages.HospitalMaster.InitializeConnection() in D:\kuwait\21JAN2014\kuwait_ON_26-2-2013\WebMediSmart\AdminPages\HospitalMaster.aspx.cs:56
   WebMediSmart.AdminPages.HospitalMaster.GetHospital() in D:\kuwait\21JAN2014\kuwait_ON_26-2-2013\WebMediSmart\AdminPages\HospitalMaster.aspx.cs:81
   WebMediSmart.AdminPages.HospitalMaster.Clear() in D:\kuwait\21JAN2014\kuwait_ON_26-2-2013\WebMediSmart\AdminPages\HospitalMaster.aspx.cs:72
   WebMediSmart.AdminPages.HospitalMaster.Page_Load(Object sender, EventArgs e) in D:\kuwait\21JAN2014\kuwait_ON_26-2-2013\WebMediSmart\AdminPages\HospitalMaster.aspx.cs:29
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +91
   System.Web.UI.Control.LoadRecursive() +74
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

版本信息:Microsoft .NET Framework版本:4.0.30319; ASP.NET版本:4.0.30319.1

在打开iis中发布的页面时出错。该解决方案在visual studio中完美运行。

1 个答案:

答案 0 :(得分:0)

我在ISS上部署网站时遇到了同样的问题,但我从另一个页面获得了解决方案。

请参阅此页....

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path

我的解决方案是

- >打开 IIS管理器并选择应用程序池

- >选择并右键单击池,然后选择高级设置

- >选择流程模型下的身份,并将其更改为 LocalSystem

- > 重新启动您的IIS或网站并浏览您的网页。

问题解决了......!