【问题标题】:Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path.由于检索用户的本地应用程序数据路径失败,无法生成 SQL Server 的用户实例。
【发布时间】:2014-01-23 08:08:33
【问题描述】:

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

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 中完美运行。

【问题讨论】:

    标签: local


    【解决方案1】:

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

    查看此页面 ....

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

    我的解决方案是

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

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

    ->在process model下选择identity,改成LocalSystem

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

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

    【讨论】:

      猜你喜欢
      • 2011-06-13
      • 2011-11-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-11
      • 1970-01-01
      • 2011-05-05
      相关资源
      最近更新 更多