Enable-Migrations "Object reference not set to an instance of an object"
I have resolved the same exception issue by specifying -StartUpProjectName
parameter of Enable-Migrations
command to my .NET framework dll with the db context. The issue might be with the weird startup project - problem in .IsWebProject() (asp.core in my case). See more detail answer on Enable-Migrations Exception calling "SetData" with "2" argument(s).