Home: dotnet pack3 does extra tag splitting

Created on 20 Oct 2016  路  4Comments  路  Source: NuGet/Home

Steps

  1. dotnet new a .csproj
  2. Add some <PackageTags> to the .csproj.
  3. dotnet restore3
  4. dotnet pack3
  5. Look at the tags in the output .nuspec

    Expected

The tags should match the contents of <PackageTags>.

Actual

Semicolons are removed. The pack task should not have these smarts. Just copy the tags as-is in the .csproj to the .nuspec. Granted, the spec about .nuspec talks about space-delimited keywords. If we want to enforce this, we should error or warn that we're mangling things.

Example

Input:

    <PackageTags>semver;semantic versioning</PackageTags>

Output:

    <tags>semver semantic versioning</tags>

Compare to project.json:

{
  "packOptions": {
    "tags": [
      "semver",
      "semantic versioning"
    ]
}
Pack Bug

All 4 comments

@joelverhagen what is the output from the project.json example in the nuspec? Wouldn't it be identical to the msbuild pack output?

A ; in MSBuild turns the value into a set the same as [] in json. I'm not sure that anything can be done here since pack isn't evaluating the ;. As mentioned there's no way to fix the output either apart from replacing spaces with . since tags are space delimited.

@emgarten there is a way to just get the whole string instead of delimiting it by ; and then splitting them by spaces, however i am not sure if that's what we want.

msbuild users will expect that ; will do the splitting as it does for other properties.

@joelverhagen what is the output from the project.json example in the nuspec? Wouldn't it be identical to the msbuild pack output?

Output of project.json dotnet pack is:

    <tags>semver,semantic versioning</tags>

This is also mangled, but there is at least a _similar_ notion of different tags. My original assertion is we should just leave as is or warn that we are normalizing the tags.

closing as the behavior looks good

Was this page helpful?
0 / 5 - 0 ratings