Failed to generate a user instance of SQL Server due to failure in retrieving the user#39;s local application data path(由于检索用户的本地应用程序数据路径失败,无法生成 SQL Server 的用户实例)
问题描述
vs2010 中的 net 项目我在 app_data 文件夹中有一个 db 和表,我创建了一个部署包并将该包导入到安装在我的本地机器上的 iis 服务器中.现在我在尝试执行插入时收到此错误消息.
net project in vs2010 i have a db and table inside the app_data folder, i have created a deployment package and have imported the package into an iis server that is installed on my local mechine. now i get this error message while trying to preform an insertion.
由于检索用户的本地应用程序数据路径失败,无法生成 SQL Server 的用户实例.请确保用户在计算机上有本地用户配置文件.连接将被关闭
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
连接字符串是:
数据源=.SQLEXPRESS;AttachDbFilename=|DataDirectory|survey.mdf;Integrated Security=True;User Instance=True
Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|survey.mdf;Integrated Security=True;User Instance=True
在 VS2010 中运行时它工作正常.
when running it inside VS2010 it`s working fine.
我该如何解决这个问题?
how can i solve this probelm ?
推荐答案
移除 User Instance=True
.您不需要 RANU 实例.接下来,确保 SQL Server Express 服务帐户 具有适当的所需权限在你的 app_data 上:
Remove the User Instance=True
. You don't need RANU instances. Next, make sure the SQL Server Express service account had the proper needed rights on your app_data:
cacls <pathapp_data> /E /T /G SQLServerMSSQLUser$<ComputerName>$SQLEXPRESS:F
这篇关于由于检索用户的本地应用程序数据路径失败,无法生成 SQL Server 的用户实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:由于检索用户的本地应用程序数据路径失败,无法生成 SQL Server 的用户实例


基础教程推荐
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01