Search code examples
c#nuget.net-corenuspec

Use "dotnet" or ".NETPlatform5.0" in NuGet nuspec?


I have a NuGet .nuspec created with with various framework dependencies.

Based on this article, one of the dependencies is "dotnet":

<group targetFramework="dotnet">
[dependencies here]
</group>

When I pack the .nuspec file using NuGet 3.3, the nuspec file that gets packed up has "dotnet" replaced by ".NETPlatform5.0":

<group targetFramework=".NETPlatform5.0">
[dependencies here]
</group>

What's the impact here, if any?

Should I use "dotnet" or ".NETPlatform5.0" going forward?


Solution

  • Eventually figured this out myself by reading the docs at NuGet and GitHub

    NuGet looks at the "dotnet" moniker and finds the best platform to use, in my case "dotnet5.0", which is actually .NETPlatform5.0.

    Confusing as hell, but that's RC life I guess :)