I'm confused about the new format in RC2 project json.
What does this actually mean?
"frameworks": {
"net451": {},
"netstandard1.5": {
"imports": [
"dotnet5.6",
"dnxcore50",
"portable-net45+win8"
]
}
},
I am assuming it means that my library / app will be built against 2 frameworks, net451 (.NET 451 desktop?) and "netstandard1.5" profile.
However what's the "imports" bit about and what does it do specifically? Where can I learn more about it? Does it mean that my assembly / library will not only have compatibility with netstandard, but also the other "imports"? If so that's odd as that would kind of be implied right by targeting netstandard anyway?
Also if I am targeting netstandard1.5 does that mean I can drop net451?
Cheers
imports enables using packages that have not been updated to use new monikers. It is like telling "trust me - dotnet5.6, dnxcore50 etc. packages will work if I target netstandard1.5". As a result NuGet will not fail to restore if a package does not target the target TFM if it targets one of the imported TFMs. You need to be careful though - you may get runtime errors if your imports enable importing incompatible packages. You should see fewer import once more NuGet packages are converted from old TFMs to new TFMs.
@moozzyk ahh I see. That makes sense. Is there a place we can see which TFM's are fully compatible with netStandard? I'm assuming "dotnet5.6", "dnxcore50", and "portable-net45+win8" are all fully compatible and wont lead to runtime errors but assumptions are the mother of all ** ups so they say!
:-)
I don't have a list like that. I think that you actually should start without any imports try to restore packages and see which packages fail to restore (typically the one that fails is JSON.NET - only the version 9.0.1-beta1 which was released a few days ago support netstandard and packages shipped in RC2 all depend on version 8.0.3 or older hence the need for imports) and then you crack open the package and check what TFMs it supports and add imports based on this. I think "dotnet5.6", "dnxcore50" are safe bets.
Ok thanks a lot ;)
Most helpful comment
imports enables using packages that have not been updated to use new monikers. It is like telling "trust me - dotnet5.6, dnxcore50 etc. packages will work if I target netstandard1.5". As a result NuGet will not fail to restore if a package does not target the target TFM if it targets one of the imported TFMs. You need to be careful though - you may get runtime errors if your imports enable importing incompatible packages. You should see fewer import once more NuGet packages are converted from old TFMs to new TFMs.