7/31/2010
LifeCycle Solutions - Home ( the software development blog )
 

<March 2009>
SunMonTueWedThuFriSat
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

Subscribe to this feed:

RSS 2.0 | Atom 1.0 |CDF






Friday, March 20, 2009

I came across this run-time error message while trying to run a web app project from Visual Studio 2008:

"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."

The app has a connectionString pointing to a SQL Server 2005 Express instance, so I checked to make sure the instance service was running and it was.  As any good computer shade tree mechanic would do, I restarted the service hoping for the best, but nothing changed.

So as always, Google to the rescue.  Joe Stagner in this blog entry describes what he did to fix the problem when he experienced it.  I deleted the corresponding folder under username and it worked!  If I had more time I'd try to dig some more for an explanation on why this happens and why the fix works, but we'll leave that exercise for another day.  For now I'm just glad it works.

Standard disclaimer: make sure you have data backed up before you go deleting things willy-nilly.  This fix worked for Joe Stagner and it worked for me, but there's no guarantee it won't fubar your SQL Server Express instance.

Update: Depending on your version of Windows, this folder may not be under 'Documents and Settings', but rather: C:\Users\USERNAME\AppData\Local\Microsoft\Microsoft SQL Server Data\SQLEXPRESS  Again, Your Mileage May Vary.

Posted by Daniel Root

© 2006 LifeCycle Solutions, LLC | All Rights Reserved