Pack from csproj does not include the minClientVersion attribute #4135

Closed
srivatsn opened this Issue Dec 21, 2016 · 4 comments

Comments

Projects
None yet
4 participants
@srivatsn

Moved from dotnet/sdk#509 filed by @onovotny

When using the pack command to create a NuPkg from a csproj, the MinClientVersion attribute is not written to the generated NuSpec despite being present in the csproj.

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Dec 30, 2016

Contributor

@onovotny I tried to repro this on my end but couldn't. I have attached the project i tried to repro this issue with. You can download it, get the latest CLI+SDK from https://dotnetcli.blob.core.windows.net/dotnet/Sdk/rel-1.0.0/dotnet-dev-win-x64.latest.zip , and run dotnet restore, dotnet build and dotnet pack on the project.

The nuspec file in the nupkg is the following :

`<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
  <metadata minClientVersion="2.8">
    <id>ClassLibrary1</id>
    <version>1.0.0</version>
    <authors>ClassLibrary1</authors>
    <owners>ClassLibrary1</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Package Description</description>
    <dependencies>
      <group targetFramework=".NETStandard1.4">
        <dependency id="NETStandard.Library" version="1.6.0" exclude="Build,Analyzers" />
      </group>
    </dependencies>
  </metadata>
</package>`

ClassLibrary1.zip

Contributor

rohit21agrawal commented Dec 30, 2016

@onovotny I tried to repro this on my end but couldn't. I have attached the project i tried to repro this issue with. You can download it, get the latest CLI+SDK from https://dotnetcli.blob.core.windows.net/dotnet/Sdk/rel-1.0.0/dotnet-dev-win-x64.latest.zip , and run dotnet restore, dotnet build and dotnet pack on the project.

The nuspec file in the nupkg is the following :

`<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
  <metadata minClientVersion="2.8">
    <id>ClassLibrary1</id>
    <version>1.0.0</version>
    <authors>ClassLibrary1</authors>
    <owners>ClassLibrary1</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Package Description</description>
    <dependencies>
      <group targetFramework=".NETStandard1.4">
        <dependency id="NETStandard.Library" version="1.6.0" exclude="Build,Analyzers" />
      </group>
    </dependencies>
  </metadata>
</package>`

ClassLibrary1.zip

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Jan 3, 2017

Contributor

@onovotny : were you able to try this at your end?

Contributor

rohit21agrawal commented Jan 3, 2017

@onovotny : were you able to try this at your end?

@onovotny

This comment has been minimized.

Show comment
Hide comment
@onovotny

onovotny Jan 3, 2017

Yes, sorry, was out last week.

Here's what I see -- the nupkg does have the attribute set, but the generated NuSpec in the obj directory does not....that's what threw me. I would have expected the generated nuspec file to have minClientVersion set as well.

onovotny commented Jan 3, 2017

Yes, sorry, was out last week.

Here's what I see -- the nupkg does have the attribute set, but the generated NuSpec in the obj directory does not....that's what threw me. I would have expected the generated nuspec file to have minClientVersion set as well.

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Jan 3, 2017

Contributor

aah ok, if that's the case, it's a bug too. let me investigate more.

Contributor

rohit21agrawal commented Jan 3, 2017

aah ok, if that's the case, it's a bug too. let me investigate more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment