0

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

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
San Jaisy
  • 15,327
  • 34
  • 171
  • 290
  • This solution work for me https://stackoverflow.com/questions/38705694/add-migration-with-different-assembly – San Jaisy Sep 18 '17 at 02:27

3 Answers3

0

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.

ankitmvp
  • 33
  • 4
  • Its start. I am able to browse the database from SSMS. Only from visual studio its not working. – San Jaisy Sep 17 '17 at 12:22
  • Just check whether your Visual studio instance is running with Admin rights or not. If not, close visual studio and right click on its icon and then click on 'Run as administrator' and then retry. – ankitmvp Sep 18 '17 at 07:29
0

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

San Jaisy
  • 15,327
  • 34
  • 171
  • 290
0

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

Hoque MD Zahidul
  • 10,560
  • 2
  • 37
  • 40