1

Im trying to run dnx ef migrations Add IntitialDatabase. However, it fails to run and gives the error "Could not load Assembly 'MyProject.' Ensure it is referenced by the startup project 'MyProject.'"

Where is it looking for this reference so that I can correct the mismatch?

HendPro12
  • 1,094
  • 3
  • 17
  • 50

2 Answers2

0

Strangely enough this error was the result of my having an incomplete constructor in one of my controllers. When I added the missing closing bracket and ran the add migration again it completed successfully without the assembly error.

HendPro12
  • 1,094
  • 3
  • 17
  • 50
0

You have to set as startup project, which the project in solution add migration. Then you can change. Right click on project and select "set as startup project".

double-beep
  • 5,031
  • 17
  • 33
  • 41
  • Or other way, right click solution and select "Properties". After u see "Multiple startup projects", chose and there see your projects on your solution. You can set whatever you want as a startup project. – Bünyamin Aslan May 26 '20 at 16:38