user9171788
user9171788

Reputation:

Share Library between UWP App and .NET Core

What is the best practice to share a library (also C# project) between Windows UWP app and a .NET Core web app?

I have the following solution setup starting from scratch:

As far as I could figure out, the only solution is, to create two projects for the lib, which share the same .cs files. But this feels a bit like a workaround and I am looking for a "clean(er)" way.

Upvotes: 3

Views: 591

Answers (1)

Gene
Gene

Reputation: 4232

You can share a .NET Standard 2.0 library between those projects, see Microsoft's documentation.

Note, that you cannot use any classes specific to .NET Core or the UWP in such a project.

.NET Standard in VS2019

Upvotes: 5

Related Questions