2

In my solution I am using

  • ef6 for persistence library targeting the full .NET framework
  • For web API => ASPNetCore targeting the full .NET framework

Now when it comes to use aspnetcore identity, it's dependent on EFCore 2.0 and VS is not able to make migration when it comes to have EF6 and EFCore together in the same VS solution - it causes a command line error.

I have the following options :

thanks Jamal

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • 3
    I'm sorry, I'm unsure what your question is. If you have an error message, why don't you show it? If you already know the solutions, what is the question? – trailmax Mar 16 '18 at 10:55
  • I also am having trouble with this. I don't know about Jamal, but the error I'm getting when trying to apply the migration (Update-Database in Nuget Package Manager Console) is: Exception calling "SetData" with "2" argument(s) ... Object reference not set to an instance of an object – Nacho Feb 06 '19 at 21:54

1 Answers1

0

If anyone stumbles over this. Until EF 6.3 is released, the solution is to revert the library project with the context in it back to the old csproj format (the really verbose one), setting that library project as startup project, and selecting it as default project in the package manager console.

That will then allow you to use the migration tools as usual. You'll of course have to change the startup project back to run the web app.

gmateo
  • 1
  • 1