Fix error "Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance."

Au moment de la première installation de SQL Server et de Visual Studio sur une plateforme de développement logiciel,  vous ne pouvez pas utiliser SQL Server avec Visual Studio !? Vous êtes surpris ... ? Et pourtant c'est la vérité ! Voici donc la solution ...

Solution pour utiliser Visual Studio avec SQL Server

Parfois, j'ai peur que des soucis résolus disparaissent des serveurs et donc je copie la solution chez moi ... ;)
Windows 7, SQL Serveur 2008 Express Visual Studio 2010, je rencontre à nouveau ce problème. Si ce n'est pas une honte et ben oui cet idiot de SQL Serveur par défaut à l'installation, il n'autorise pas la création d'une instance de serveur par un utilisateur et VS (Visual Studio) ne peut donc pas l'utiliser (et vous trouvez ça normal ?!)

Les sources ici.

Have you ever tried to create a user instance database from Visual Studio on SQL Server 2005 Express (or above) and got this terrible (can it be more confusing?) message:

"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." If you did and tried to find how to resolve this you probably Googled (or Binged) for hours without being able to find the solution that really works.

Well lets put an end to that. Two simple things need to be done:

Step 1. Enabling User Instances on your SQL Server installation First we are gonna make sure we have enabled User Instances for SQL Server installation.

Go to Query Window in SQL Server Management Studio and type this:

exec sp_configure 'user instances enabled', 1.
Go 
Reconfigure
Run this query and then restart the SQL Server.

Step 2. Deleting old files
Now we need to delete any old User Instances.
Go to your C drive and find and completely DELETE this path (and all files inside):

C:\Documents and Settings\YOUR_USERNAME\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS

(Dont forget to replace the green text in the path with your current username (if you are not sure just go to C:\Documents and Settings\ path to figure it out).

After deleting this dir you can go to Visual Studio, create ASP.NET WebSite and click on your App_Data folder and choose Add New Item and then choose SQL Server Database and it should work!!!

Addendum

Depuis que j'ai écris ce post, il me semble bien que l'article n'est plus accessible sur le site de aspdotnetfaq.
Et que la syntaxe de la commande est plutôt :

exec sp_configure 'user instances enabled', '1'

pas besoin du Go ... Have fun !

Autres lectures sur le sujet 

http://stackoverflow.com/questions/20865437/the-configuration-option-user-instances-enabled-does-not-exist
The problem is known issue. SQL Express cannot create a user instance using the set of engine files in your local app data folder, deleting them should allow sql server to recreate them with the correct credentials for you to F5 successfully.