0

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

Akram Shahda
  • 14,655
  • 4
  • 45
  • 65
  • Try [this](http://www.aspdotnetfaq.com/Faq/fix-error-Failed-to-generate-a-user-instance-of-SQL-Server-due-to-a-failure-in-starting-the-process-for-the-user-instance.aspx). Or [this](http://stackoverflow.com/questions/281500/error-failed-to-generate-a-user-instance-of-sql-server). – Michael Todd Apr 21 '11 at 22:40

1 Answers1

0

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.

NotMe
  • 87,343
  • 27
  • 171
  • 245