ASP.NET、SQL Express 和“由于启动用户实例进程失败,无法生成 SQL Server 的用户实例”
我编写了一个新的 ASP.NET 程序,打算出售,所以我认为合理的选择是 SQL Express,我计划允许用户使用他们自己的 SQL 服务器(如果他们愿意)。我的程序需要应用程序池使用网络服务帐户来运行。网络服务帐户具有对数据库文件的 mmodify 权限。
为了进行测试,我已将程序发送给几位同事和朋友,当在安装了 SQL Express 2008 R2 的新服务器上安装时,每个人都会收到以下错误。我还可以在新服务器上重新创建错误,但在 VS 中调试它工作正常。
生成用户实例失败 SQL Server 由于故障 为用户启动进程 实例。连接将是 已关闭
我正在使用以下连接字符串,我认为这是正确的。
"Data Source=.\SQLExpress;AttachDbFilename=|DataDirectory|\Database.mdf;
Integrated Security=True;User Instance=True"
我做错了什么?我还可以通过什么其他方式将数据库与安装程序一起发送并使其首次运行?
谢谢 大卫
I have written a new ASP.NET program that I intend to sell so I thought the logical choice was SQL Express, I plan on allowing users to use their own SQL server if they prefer. My program requires the Application Pool to use the Network Service account to operate. The Network Service account has mmodify permission to the database file.
For testing I have sent my program to several colleagues and friends and each receive the error below when installing on a new server with SQL Express 2008 R2 installed. I can also recreate the error on new servers but debugging in VS it works fine.
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
I am using the following connection string which I believe to be correct.
"Data Source=.\SQLExpress;AttachDbFilename=|DataDirectory|\Database.mdf;
Integrated Security=True;User Instance=True"
What have I done wrong? What other way could I send the database along with an installer and make it work first time?
Thanks
David
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从这里开始:
http://dotnetslackers.com/Community/博客/bmains/archive/2008/03/01/由于启动进程失败而无法生成 sql-server 的用户实例user-instance-the-connection-will-be-close.aspx
执行此操作时,请确保将 sql express 实例设置为在“本地”或“系统”帐户下执行。
Start here:
http://dotnetslackers.com/Community/blogs/bmains/archive/2008/03/01/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.aspx
While at it, make sure the sql express instance is set to execute under the "local" or "system" accounts.