You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Project template for .NET Standard Class Library should have 3 digit version for the NETStandard.Library package reference #413
SemVer is a 3 part version. It even shows up as 1.6.0 in the references node. It also makes it easier to change the 3rd number when you want to bump up the patch. Are the templates in this repository? I can send a PR..
I think the templates for dotnet new are in the CLI repo separately.
While I would agree with changing the versions on the packages to include the minor version, I'm hoping to get rid of the PackageReference for NETStandard.Library from the templates altogether. It's confusing when people see the TargetFramework is netstandard1.4 but they're referencing version 1.6 (or 1.6.0) of the .NET Standard package. I think we should just reference the right package for you in the SDK based on the project's target framework.
The NETStandard.Library package supports targeting previous versions of .NET Standard with the latest package. So you can reference the 1.6.1 version of the package but target all the way down to .NET Standard 1.0. I believe this will continue in the future, so the SDK can just give you the most recent version of the package (at the time the SDK shipped) no matter which version of .NET Standard you're actually targeting.
Yea, I know this (I was part of the set of people that came up with it). I was questioning the fact that if you remove the package reference and infer it from the TFM, you have to express patch versions somehow e.g.
netstandard1.6 = Infers NETStandard.Library 1.6.0
netstandard1.6.1 = ???
Do we start putting 3 part version numbers in TFMs to express the exact package version we want?
No, I'm saying that the SDK should infer which package to reference based on the target framework (identifier), but not the version. So a target framework of netstandard 1.6 or netstandard 1.2 or 1.0 implies that the NETStandard.Library package should be referenced, but the version that would be referenced would (today) always be 1.6.1. When a newer version of the NETStandard.Library package comes out, there would be a newer version of the SDK that would automatically give you that version of the package.
What if i don't want to reference NETStandard.Library? Like a class lib that only needs System.Runtime for netstandard1.0? AFAIK it is still recommended to trim your dependencies to the minimum set required when publishing a NuGet for netstandard < 2.0.
AFAIK it is still recommended to trim your dependencies to the minimum set required when publishing a NuGet for netstandard < 2.0.
No, that ship has sailed. We're recommending people use NETStandard.Library. Also with netstandard 2.0 it won't be possible to break it down any further as that's the minimal set of dependencies that any valid .NET implementation will need to implement.
@davidfowl I'm not sure. You should be able to explicitly specify the package version in the project file if you want a different version than the default. But for the shared framework, it might also make sense to just let you specify the patch version in the TargetFramework property, ie <TargetFramework>netcoreapp1.1.2</TargetFramework>.
Right, we don't do this today (though it's probably supported) and that was one of the problems with leaving the package reference out in the first place. Today the shared framework does auto roll forward to the highest patch so maybe this isn't a huge problem..
Activity
dsplaisted commentedon Nov 21, 2016
What's the reason for preferring 3 digits over 2 in this case?
davidfowl commentedon Nov 21, 2016
SemVer is a 3 part version. It even shows up as 1.6.0 in the references node. It also makes it easier to change the 3rd number when you want to bump up the patch. Are the templates in this repository? I can send a PR..
dsplaisted commentedon Nov 21, 2016
Ah, I didn't read the issue title closely enough. I thought you were talking about the target framework property, like this:
The templates in this repo are here: https://github.com/dotnet/sdk/tree/master/src/Templates/ProjectTemplates
I think the templates for
dotnet neware in the CLI repo separately.While I would agree with changing the versions on the packages to include the minor version, I'm hoping to get rid of the
PackageReferencefor NETStandard.Library from the templates altogether. It's confusing when people see theTargetFrameworkis netstandard1.4 but they're referencing version 1.6 (or 1.6.0) of the .NET Standard package. I think we should just reference the right package for you in the SDK based on the project's target framework.davidfowl commentedon Nov 21, 2016
That would be ideal but then we need a way to express the patch version. It's pretty rare for TFMs to express the patch though it's possible.
dsplaisted commentedon Nov 21, 2016
The NETStandard.Library package supports targeting previous versions of .NET Standard with the latest package. So you can reference the 1.6.1 version of the package but target all the way down to .NET Standard 1.0. I believe this will continue in the future, so the SDK can just give you the most recent version of the package (at the time the SDK shipped) no matter which version of .NET Standard you're actually targeting.
davidfowl commentedon Nov 21, 2016
Yea, I know this (I was part of the set of people that came up with it). I was questioning the fact that if you remove the package reference and infer it from the TFM, you have to express patch versions somehow e.g.
netstandard1.6 = Infers NETStandard.Library 1.6.0
netstandard1.6.1 = ???
Do we start putting 3 part version numbers in TFMs to express the exact package version we want?
dsplaisted commentedon Nov 21, 2016
No, I'm saying that the SDK should infer which package to reference based on the target framework (identifier), but not the version. So a target framework of netstandard 1.6 or netstandard 1.2 or 1.0 implies that the NETStandard.Library package should be referenced, but the version that would be referenced would (today) always be 1.6.1. When a newer version of the NETStandard.Library package comes out, there would be a newer version of the SDK that would automatically give you that version of the package.
davidfowl commentedon Nov 21, 2016
Show me an example of what you think that would look like in the project file.
dasMulli commentedon Nov 22, 2016
What if i don't want to reference NETStandard.Library? Like a class lib that only needs
System.Runtimefornetstandard1.0? AFAIK it is still recommended to trim your dependencies to the minimum set required when publishing a NuGet fornetstandard< 2.0.davidfowl commentedon Nov 22, 2016
No, that ship has sailed. We're recommending people use NETStandard.Library. Also with netstandard 2.0 it won't be possible to break it down any further as that's the minimal set of dependencies that any valid .NET implementation will need to implement.
dsplaisted commentedon Nov 24, 2016
@davidfowl
davidfowl commentedon Nov 24, 2016
@dsplaisted Where do I indicate the patch version of the shared framework I want to use? Or is that just gone?
dsplaisted commentedon Nov 24, 2016
@davidfowl I'm not sure. You should be able to explicitly specify the package version in the project file if you want a different version than the default. But for the shared framework, it might also make sense to just let you specify the patch version in the
TargetFrameworkproperty, ie<TargetFramework>netcoreapp1.1.2</TargetFramework>.davidfowl commentedon Nov 24, 2016
Right, we don't do this today (though it's probably supported) and that was one of the problems with leaving the package reference out in the first place. Today the shared framework does auto roll forward to the highest patch so maybe this isn't a huge problem..
dsplaisted commentedon Jan 5, 2017
This version number is no longer part of the templates as of #450. In the targets files it is specified with the 3 digit version number.