由于无法检索用户的本地ap,无法生成SQL Server的用户实例

时间:2011-06-09 13:44:53

标签: asp.net

这是我第一次部署asp.net网站。一切都在我的本地计算机上工作正常,但当我在远程计算机上发布网站时,我收到错误"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"

(仅限尝试访问数据库的页面)

帮助取悦

3 个答案:

答案 0 :(得分:22)

在Vista / Windows 7 / Server 2008 OS下的IIS中, 选择应用程序池,然后选择“高级设置”。在“流程模型”下找到“加载用户配置文件”并将其设置为true。

现在应该在默认的应用程序池帐户下加载SQL。

答案 1 :(得分:1)

尝试以下方法:

  • 启动IIS
  • 点击打开应用程序池
  • 右键单击DefaultAppPool并选择“选择应用程序池” 默认值”
  • 将“身份”属性更改为“NetworkService”
  • 保存并退出IIS

答案 2 :(得分:0)

您必须根据托管服务器调整connection string

根据SQL server user name and password

修改web.config的以下部分
<connectionStrings>
    <add name="DBName" providerName="System.Data.SqlClient" 
      connectionString="uid=; pwd=; database=; server=;"/>
</connectionStrings>
相关问题