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

后端 未结 4 1046
北海茫月
北海茫月 2020-12-06 09:39

I\'ve attempted to add a \"service based data base\" (.mdf) to a project in an asp .net application. From there I\'ve proceeded attempted to create an entity framework model

相关标签:
4条回答
  • 2020-12-06 10:06

    I had this exact same problem with a C# Console App that was utilizing an .mdf file.

    The issue disappeared once I granted NETWORK SERVICE full access to my root-level Visual Studio project directory (and sub directories).

    Solution Details: Problems with SQL Server Express user instancing and ASP.net Web Application Projects

    0 讨论(0)
  • 2020-12-06 10:19

    See this answer, which might work for you.

    Based on your connection string, you might need to add "User Instance" attribute to it.

    0 讨论(0)
  • 2020-12-06 10:20

    I was facing same issue in VS 2019. if anyone still facing same issue then please make sure you have/do following things: 1. you should have Sql server Express installed on your m/c 2. should have SSDT installed in VS (in VS 2019- name sure to check this component while installing) for previous version; i guess you have to add this externally 3. add 'User Instance = True' to your connection string and one more thing and I think its optional - open VS and SQL in administrative mode

    0 讨论(0)
  • 2020-12-06 10:27

    I have got the same error, it's fixed after the following change.

    Deleting the folder C:\Users\User\AppData\Local\Microsoft\Microsoft SQL Server Data worked for me in Windows 7. Have to restart VS after deleting the folder.

    0 讨论(0)
提交回复
热议问题