UWP project not compatible with netcoreapp2.1

若如初见. 提交于 2021-01-28 12:31:57

问题


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


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/55468660/uwp-project-not-compatible-with-netcoreapp2-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!