我正在尝试连接到MDF.我甚至完全重新安装了sql server express(它现在是我的盒子上安装的唯一SQL的味道,之前我有05开发和快递).我已经证实路径都是正确的,到目前为止我的google-fu还没有帮助.
完整的异常消息是:
由于启动用户实例的进程失败,无法生成SQL Server的用户实例.连接将被关闭.
连接字符串是:
<add name= "CustomerEntities"
connectionString="metadata=res://*/Data.CustomerModel.csdl|res://*/Data.CustomerModel.ssdl|res://*/Data.CustomerModel.msl;
provider=System.Data.SqlClient;
provider connection string='Data Source=.\SQLEXPRESS;
AttachDbFilename=\App_Data\CustomerDb.mdf;
Integrated Security=True;
User Instance=True'"
providerName="System.Data.EntityClient" />
Run Code Online (Sandbox Code Playgroud)
我在网上发现的这个错误的几个引用不适用于我.例如,我看到的是尝试通过远程桌面启动用户实例时发生此错误的地方(我在本地执行此操作).虽然另一个人建议它与旧的快速安装中的剩余文件有关...我已经查看了指定的位置而没有找到那些文物.我也尝试过跑sp_configure 'user instances enabled', '1',但它说它已经设置为1.
user-instance sql-server-express visual-studio sql-server-2008-r2
System.Data.SqlClient.SqlException: Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.
有人得到这个错误和/或对它的原因和/或解决方案有任何想法吗?
更新
连接字符串是 =.\SQLEXPRESS;AttachDbFilename=C:\temp\HelloWorldTest.mdf;Integrated Security=True
建议User Instance=false工作.