I have some codebase from which I want to build a .NET Core library and a UWP library. Initially, I wanted to build a single lib which would serve for both but I didn't find a way for this (in UWP case, the lib needs to reference UWP specific classes like StreamSocket).
So I created a separate project file for UWP. However, looks like I can't create a separate project.json (I can't have core.json and uwp.json because project.json name is constant). And I don't want to create multiple copies of my codebase (each one with its own project.json) in different folder, I'd rather keep a single copy.
Is it feasible somehow?
The cleanest way to achieve this would be to have three libraries:
Keep all of the shared, platform-neutral code in MyLib.Common, and reference that from the two platform-specific projects. This way, you have little or no code duplication, and you can also reference UWP-specific libraries from the UWP project without any problems.
You might also be able to get two projects to reference the same
.cs
files (and get rid of the shared project), but that seems more hackish to me.