Entity Framework Tools not working with UWP apps C#

.net c# entity-framework-core sqlite uwp

Question

Startup project 'EFGetStartedUWP' is a Universal Windows Platform app. This version of the Entity Framework Core Package Manager Console Tools doesn't support this type of project. For more information on using the EF Core Tools with UWP projects, see https://go.microsoft.com/fwlink/?linkid=858496

I'm trying to connect SQLite Database to a basic UWP app for the sake of learning but when I try migration. It just keep giving me the above error. I've searched quite a lot on the internet but didn't get the appropriate answer. The Microsoft documentation is of no use in this scenario. Also I've installed Microsoft.EntityFrameworkCore.Sqlite & Microsoft.EntityFrameworkCore.Tools.

If anyone can suggest any other way to connect SQLite database to UWP that'll be very useful too as I'm quite new to C# and I've a university project to do on a UWP app.

1
1
12/22/2019 12:53:45 PM

Popular Answer

This looks to be a known issue from here: https://github.com/aspnet/EntityFrameworkCore/issues/9666

Using EFCore with UWP is a bit finicky.

So, add a new project to your solution -> select .net core console app -> create DBContext and your models there -> run the "Add-Migration" command and reference it back to your main project.

That should get rid of that error and let you use migrations with UWP.

0
12/22/2019 1:09:35 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow