Skip to content

NuGet packages produced with 3.0 SDK cannot be used by 2.2 SDK users...depending on your timezone #8603

Closed

Description

@natemcmaster

Packages produced with a 3.0 .NET Core SDK cannot be consumed by 2.2 or 2.1 SDK users under the following conditions:

The producer:

  • Build and released a package with a .NET Core 3.0 SDK

The consumer:

  • The consumer is on a computer with the timezone set to GMT > 0 (e.g. Europe, Asia)
  • The consumer is attempting to produce their own package which contains the content from the 3.0 package. Example: PackAsTool projects, which re-distribute all dependencies in a new package.

Real world example: natemcmaster/CommandLineUtils#277

Details about Problem

NuGet product used: dotnet.exe
dotnet.exe --version: 3.0 RC1 / 2.2 (any)

Minimal repro

  1. Install both .NET Core 2.2 and 3.0 SDKs
  2. Switch computer timezone to UTC+1
  3. Run these steps
# Produce
echo '{"sdk":{"version": "3.0.100-rc1-014190" } }' > global.json
dotnet new classlib -o ClassLib12345
dotnet pack ClassLib12345 --output "$(pwd)/nupkg"

# Consume
echo '{"sdk":{"version": "2.2.300" } }' > global.json
dotnet new console -o MyConsoleTool
dotnet add MyConsoleTool/ package ClassLib12345 --source "$(pwd)/nupkg"
dotnet pack MyConsoleTool/ /p:PackAsTool=true

Result

dotnet pack fails due to #7395.

C:\Program Files\dotnet\sdk\2.2.300\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(199,5): error : The DateTimeOffset specified cannot be converted into a Zip file timestamp. [C:\tmp\MyConsoleTool\MyConsoleTool.csproj]
C:\Program Files\dotnet\sdk\2.2.300\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(199,5): error : Parameter name: value [C:\tmp\MyConsoleTool\MyConsoleTool.csproj]

This appears to be a byproduct of the 3.0 "deterministic pack" feature.

Activity

  1. nkolev92 commented on Sep 18, 2019

    @nkolev92
    Member

    Thanks for bringing this to our attention @natemcmaster

    This is addressed by the revert of the feature in 5.3 / .NET Core 3.0 in NuGet/NuGet.Client#3058.

    The long term plan is tracked in #8601 and will account for this scenario.

  2. nkolev92 commented on Sep 18, 2019

    @nkolev92
    Member

    Closing this per my above comment, we'll certainly account for this in our future work for deterministic.

  3. added this to the 5.3 milestone on Sep 18, 2019
  4. ViktorHofer commented on Sep 20, 2019

    @ViktorHofer

    I'm unsure that this is really fixed. I'm still hitting this with SDK 3.0.100-rc2-014269 and the ingestion commit b75150f2f4127a77a166c9552845e86fb24a3282 (dotnet/sdk@3d4cfe6).

  5. ViktorHofer commented on Sep 20, 2019

    @ViktorHofer
  6. ViktorHofer commented on Sep 20, 2019

    @ViktorHofer

    Ok, sorry for the confusion. In arcade we haven't received the new version therefore in one of our packages where we depend on nuget libs we are carrying the older 5658 version around.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions