Is the dotnet5.4 TFM forward compatible to RC2?

567 views Asked by At

If I were to release a new version of a library with support for the dotnet5.4 moniker, will it be consumable from .NET Core 1.0 RC2 or will I need to explicitly release a new version that targets netstandardX?

(I realise these monikers aren't actually equivalent, its more about maintaining support for .NET Core)

2

There are 2 answers

4
Damien Dennehy On BEST ANSWER

"dotnet" monikers are mapped to "netstandard", so you should use dotnet for now.

Note that dotnet5.4 is a little restrictive in that it only runs on .NET Framework 4.6 or later, Universal Windows Platform 10 (UWP), DNX Core 5.0 and Mono/Xamarin platforms.

EDIT: According to David Fowler my original answer is incorrect and "dotnet" and "netstandard" are not interchangeable anymore. You'll need to import dotnet5.x explicitly.

{
    "frameworks": {
        "netstandard1.5": {
            "imports": "dotnet5.6",
            "dependencies": {
            "SomeDependency": "1.0.0"
            }
        }
    }
}
0
Richard Szalay On

Update based on a conversation on GitHub with @davidfowl

Essentially, the answer us "no, dotnetX libraries will not automatically be consumed by rc2+ projects targetting netstandardX".

However, NuGet (circa rc2) will support an "imports" property in project.json, that will include other targets with a framework. The feature has been described as "go away NuGet, I know what I want"

For example, to include dotnet5.4 libraries in your netstandard1.3 project build, you would use:

{
  "frameworks": {
    "netstandard1.3": {
      "imports": "dotnet5.4"
    }
  }
}