A network-related or instance-specific error occur

2019-09-14 22:18发布

问题:

I, am using package manager console to perform the database migration.

I used the following command

Add-Migration init

This command work perfectly and created the migration object as see in the below image

Now I am using

Update-Database

command to create the database however I, am getting an error as shown below

I have used the solution provide here and this question.

However, this solution is not working for me from visual studio.

I, am able to use the sql server from SSMS. This error is from visual studio.

Here is the firewall screen shot

回答1:

Might be your connection to SQL is not started. Just follow below steps: 1. Go to run command or press Windows+R key and enter services.msc. 2. Find SQL Server (MSSQLSERVER) there and right click on it and click on start option. Then retry.



回答2:

This solution work for me.I change the statrtup.cs file as per the below repo

https://github.com/bricelam/Sample-SplitMigrations

Add migration with different assembly