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 imagemigration image

Now I am using

Update-Database

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

error details

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 enter image description here

3

There are 3 best solutions below

0
On

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

2
On

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.

1
On

In My Case appsettings.Development.json contain another server Name that was collupse thats why i never noticed .