At the moment I am writing an application that would work on a wide variety of platforms. As planned, all types of applications will use a common model and controller (ViewModel). The model and the controller were written in the form of .dll libraries on .NET Core 2.1, but the snag is that it is not possible to specify a link to the library from WPF and UWP projects.

As far as I know, UWP applications are based on the .NET Core platform, but when you try to specify a link, a message appears like "Unable to add reference to project% ProjectName%". For WPF, I found a solution on the Internet based on compiling either the NuGet package, and for UWP projects, as I understand it, this solution is not appropriate.

Actually the question is, how can you get out of this unpleasant situation and use libraries from different projects? The model and controller are written platform-independent. Maybe there is a better way?

The WPF application is based on the .NET Framework 4.7.1, and the UWP application has UWP version 6.1.5 (minimum version of Fall Creators Update)

  • one
    I would look in the direction of .NET Standard - I just have applications on WPF and asp.net core 2, which use a common lib on .NET Standard - tym32167
  • one
    It probably depends on what you used in your library. For me, the transition to the .NET Standard was simply to switch the Target Framework in the project properties. But I did not use anything in my lib but sockets and regulars. - tym32167
  • one
    Well, and as an example, I made a pull request for the other envelope in .NET Standard 2 - tym32167
  • one
    Yes, and also, in .NET Standard you need to manually set the encodings , out of the box there isn’t - tym32167
  • one
    I would not advise you to climb into the project files with your hands, just in the Solution Explorer you right-click on the project - properties - there is a Target Framework field in the form of a dropout - choose .NET Standart there. For example, after this I have not only changed the Target Framework - tym32167

0