NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 252 forks source link

dotnet pack fails with paket and .NET Core 2.1.500 #7514

Open livarcocc opened 6 years ago

livarcocc commented 6 years ago

From @dbrattli on November 15, 2018 17:33

Steps to reproduce

Add Paket to any project and run dotnet pack will fail after installing .NET Core 2.1.500. The error message is The provided SymbolPackageFormat value is invalid.. It seems to be breaking since the new property does not have a default.

This issue is tracked in the Paket manager at: https://github.com/fsprojects/Paket/issues/3427

Expected behavior

dotnet pack should succeed.

Actual behavior

Fails with error:

➜  classlib dotnet pack                  
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  shasum: /Users/dbrattli/Developer/GitHub/classlib/.paket/../paket-files/paket.restore.cached: 
  Paket version 5.188.1
  Starting full restore process.
  Performance:
   - Disk IO: 17 milliseconds
   - Runtime: 2 seconds
  Restoring packages for /Users/dbrattli/Developer/GitHub/classlib/classlib.csproj...
  Restore completed in 178.88 ms for /Users/dbrattli/Developer/GitHub/classlib/classlib.csproj.
  Paket version 5.188.1
  The last restore is still up to date. Nothing left to do.
  Performance:
   - Runtime: 60 milliseconds
  classlib -> /Users/dbrattli/Developer/GitHub/classlib/bin/Debug/netstandard2.0/classlib.dll
  Paket version 5.188.1
  Performance:
   - Runtime: 644 milliseconds
/Users/dbrattli/Developer/GitHub/classlib/.paket/Paket.Restore.targets(226,5): error : The provided SymbolPackageFormat value  is invalid. Allowed values : 'snupkg', 'symbols.nupkg'. [/Users/dbrattli/Developer/GitHub/classlib/classlib.csproj]

Environment data

dotnet --info output:

.NET Core SDK (reflecting any global.json): Version: 2.1.500 Commit: b68b931422

Runtime Environment: OS Name: Mac OS X OS Version: 10.14 OS Platform: Darwin RID: osx.10.14-x64 Base Path: /usr/local/share/dotnet/sdk/2.1.500/

Host (useful for support): Version: 2.1.6 Commit: 3f4f8eebd8

Copied from original issue: dotnet/cli#10345

forki commented 6 years ago

som the issue is that the new MSBuild NuGet pack task comes with a new property for symbols file endings, but this property does not have a default. This is a breaking change since now older builds that use the pack task just fail.

Unfortunately we can't just add the property to our targets file since the old task doesn't have that property and MSBuild will therefor fail on SDK < 2.1.500.

So Paket team needed to check msbuild versions in the targets file and add yet another conditinal:

https://github.com/fsprojects/Paket/pull/3428

netcore-jroger commented 6 years ago

how to resolve this problem ? @forki

forki commented 6 years ago

We applied an ugly workaround in paket.