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 的用户实例
基础教程推荐
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- WPF 模态进度窗口 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
