Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

How do you run EF migrations from a custom NuGet package?

$
0
0

I have a c# class libary that has its own database context and Entity Framework migrations.

My solution contains a web site that references the class library as a Project Reference.

I can apply the EF migrations for the Class Library in Visual Studio from Package Manager Console by setting the default project to my Class Library and using the following command:

update-database -StartupProject MyMainWebProj -Context MyClassLibDbContext

I have created a private NuGet package for the class libary and updated the Web Site to reference the NuGet package rather than a project reference.

I cannot figure out how to run the EF migrations now that the class library is referenced via NuGet package.


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>