UWP project not compatible with netcoreapp2.1

1.3k Views Asked by At

I created an UWP app and I will use entityFrameworkCore to create my DB with code first. My app console (entityFrameworkCore app) works and creates my DB but when I make a reference to my UWP project it doesn't work and shows this error:

The project uwp is not compatible with netcoreapp2.1(.NETCoreApp,version=v2.1)

And when i would like add a reference in uwp to db project i have this error enter image description here

2

There are 2 best solutions below

15
mm8 On BEST ANSWER

A .NET Core app cannot add a reference to a UWP app and vice versa.

What you should do is to create a .NET Standard project where you install Entity Framework Core and define your DbContext.

You could then reference this project from both the .NET Core console app and from the UWP app.

7
ARandomCoder On

UWP isn't supported in .net core so creating .net core app won't work. create .net standart console app and include it into your UWP project