Question:
How to manage nuget packages in a VisualStudio2017
solution with 3 platforms:
- .Net Standard 1.3
- .Net Framework 4.6
- .Net Core 1.0
?
I like the PackageReference
approach, but i don't know how to use it. They talk about:
<ItemGroup>
<!-- ... -->
<PackageReference Include="Contoso.Utility.UsefulStuff" Version="3.6.0" />
<!-- ... -->
</ItemGroup>
- Does it mean that in general i need at least 3 PackageReferences for each of Framework/Standard/Core?
- How to manage the versions when we are stuck with
.Net Framework 4.6
? - I also ran across the issue when i could not run a console
.net core
app referencing.net standard
lib due to nuget versions compatibility problem.
In addition, i'd like to mention that i came across a couple of articles that stated that .csproj
s are back and there's no need of .xproj
, project.json
. Personally, i like this idea to deal with .csproj
s like previously.
Context:
I'm not a native English speaker and i'm very new to non-trivial nuget usages and .Net
Core
/Standard
development.
I'm preparing to port a .Net Framework
application to .Net
Framework
+Standard
+Core
.
This is now just a WPF application. But in the future it's intended to stay the same WPF app, but also to have a new .Net Core
branch, raising from the existing logic.
I don't know exactly what the plans are for the possible new .Net Core
branch. Most probably, the plans are to create an ASP.Net Core
website.
What i know for sure is that the task is to keep logic running as .Net Framework
(with WPF UI) and also get it implemented as .Net Core
.
I decided to use the combination of Framework
+Standard
+Core
as the solution because of its simplicity. I mean that the conception is easy to understand: base classes (standard) used by 2 brances (FWK, Core).
No need of mutitargeting or directives in code (conditional compilation).
Implying that the new solution should be created from scratch by copy-pasting and modifying.
Still not 100% sure about the reasonability of this decision.
But the question implies that this very approach is to be taken: Framework
+Standard
+Core
.
I hope taht this question is reasonable; i mean that the effective managing of nuget packages in such case is a good start for a successfull cross-platform project. Thanks!