Skip to content

Project template for .NET Standard Class Library should have 3 digit version for the NETStandard.Library package reference #413

Closed

Description

@davidfowl

This is a nit but we should fix it. The version should be 1.6.0 instead of 1.6

Activity

  1. dsplaisted commented on Nov 21, 2016

    @dsplaisted
    Member

    What's the reason for preferring 3 digits over 2 in this case?

  2. davidfowl commented on Nov 21, 2016

    @davidfowl
    MemberAuthor

    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..

  3. dsplaisted commented on Nov 21, 2016

    @dsplaisted
    Member

    Ah, I didn't read the issue title closely enough. I thought you were talking about the target framework property, like this:

    <TargetFramework>netstandard1.6</TargetFramework>

    The templates in this repo are here: https://github.com/dotnet/sdk/tree/master/src/Templates/ProjectTemplates

    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.

  4. davidfowl commented on Nov 21, 2016

    @davidfowl
    MemberAuthor

    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.

  5. dsplaisted commented on Nov 21, 2016

    @dsplaisted
    Member

    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.

  6. davidfowl commented on Nov 21, 2016

    @davidfowl
    MemberAuthor

    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?

  7. dsplaisted commented on Nov 21, 2016

    @dsplaisted
    Member

    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.

  8. davidfowl commented on Nov 21, 2016

    @davidfowl
    MemberAuthor

    Show me an example of what you think that would look like in the project file.

  9. dasMulli commented on Nov 22, 2016

    @dasMulli
    Contributor

    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.

  10. davidfowl commented on Nov 22, 2016

    @davidfowl
    MemberAuthor

    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.

  11. dsplaisted commented on Nov 24, 2016

    @dsplaisted
    Member

    @davidfowl

    Show me an example of what you think that would look like in the project file.

    <Project Sdk="Microsoft.NET.Sdk/1.0.0-rc">
      <PropertyGroup>
        <TargetFramework>netstandard1.4</TargetFramework>
      </PropertyGroup>
    
      <ItemGroup>
        <Compile Include="**\*.cs" />
        <EmbeddedResource Include="**\*.resx" />
      </ItemGroup>
    </Project>
  12. davidfowl commented on Nov 24, 2016

    @davidfowl
    MemberAuthor

    @dsplaisted Where do I indicate the patch version of the shared framework I want to use? Or is that just gone?

  13. dsplaisted commented on Nov 24, 2016

    @dsplaisted
    Member

    @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>.

  14. davidfowl commented on Nov 24, 2016

    @davidfowl
    MemberAuthor

    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..

  15. added this to the 1.0 RC2 milestone on Nov 29, 2016
  16. modified the milestones: 1.0 RC2, 1.0 RC3 on Dec 7, 2016
  17. dsplaisted commented on Jan 5, 2017

    @dsplaisted
    Member

    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.

  18. added theissue type on Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions