Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i have published my MVC 3 web application locally using IIS 7 express and visual developer express 2010, but when i tired to login to the application and after i insert the user name and password on the login view the following error was returned:-

System.Data.SqlClient.SqlException: Failed to generate a user instance of SQL Server due to a failure in impersonating the client. The connection will be closed.

so what might be causing this problme? the current connection string is :-

<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
<add name="ElearningEntities" connectionString="metadata=res://*/Models.Elearning.csdl|res://*/Models.Elearning.ssdl|res://*/Models.Elearning.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\MScProject.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
share|improve this question

Did you try this MSDN thread or this?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.