Failed to generate a user instance of SQL Server


  • I get this error when running within VS2010

    Error 1 An error occurred while establishing a connection to SQL Server instance '.\SQLEXPRESS'.
    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. C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v1.0\Microsoft.LightSwitch.targets 95 10 tutorial01

    I change to windows authentication in project properties but it changed nothing. I can access my SQLEXPRESS with SQL Data Studio Management.
    Saturday, February 26, 2011 7:33 PM

All replies

  • Changing the authentication mode of the application is not going to fix any SQL Server problems.

    There could be several reasons why you are experiencing this problem, but check the following threads to see if they help you:

    Saturday, February 26, 2011 10:58 PM
  • Wow thanks for the link but as I read the thread the diagnostic and fixing seems very complicated ! I wanted to try Lightswitch because supposedly it does avoid system problem as it was targeting people like power user who are not system programmer but it seems it's even more a headache than setup a classical DB application in a winform app :(.

    Is this because it is bêta or will it persist even in final release ? If it persists I think I will have to give up because I don't have a deep knowledge of SQL Server and Security Schema which I thought once again Ligthswitch would allow me to alleviate.


    Saturday, February 26, 2011 11:15 PM
  • Hi,

    In this case SQL Express failed to generate a User Instance on your machine. It does not relate to any aspects of an application. Can you try the following steps:

    1.   Save and Close your LightSwitch project
    2.   Stop all instances of SQL Express on your local machine
    3.   End all user instance processes of SQL Express (process name: sqlservr.exe owner will be currently logged in user)
    4.   Delete all files in %LOCALAPPDATA%\Microsoft\Microsoft SQL Server Data\SQLEXPRESS
    5.   Restart all SQL Express instances on your local machine
    6.   Open your LightSwitch project and rebuild all


    LightSwitch still has to rely on SQL Server for data storage. Even with a Windows Form application, it is still neccessary to have the SQL Server instance on your machine running to be able to write the application. I'm afraid having SQL Experss installed and functioning correctly will still be a requirement in final release.

    Best regards,

    Thursday, March 03, 2011 7:39 PM