Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dbrattli opened this issue Nov 15, 2018 · 27 comments
Closed

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

dbrattli opened this issue Nov 15, 2018 · 27 comments

Comments

@dbrattli
Copy link

@dbrattli dbrattli commented Nov 15, 2018

Description

Get the error message when running dotnet pack with .NET Core 2.1.500:

/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]

I have no idea is this is an issue is related to dotnet and/or paket. Tested on Mac OS X 14.4.1, and Windows 10, and get the same error on three different machines and installations.

Repro steps

  1. Install .NET Core 2.1.500, https://www.microsoft.com/net/download

  2. dotnet new classlib -o myproject

  3. Add paket to new project and initialize. Add a nuget to dependencies so project file classlib.csproj imports Paket.Restore.targets`:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>
  <Import Project=".paket\Paket.Restore.targets" />
</Project>
  1. dotnet restore

  2. dotnet build

  3. dotnet pack

Expected behavior

Expected behavior is that dotnet pack completes without error. This used to work in earlier versions of dotnet.

Actual behavior

➜  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]

Known workarounds

Don't know any workarounds. Downgrading dotnet might work.

@forki

This comment has been minimized.

Copy link
Member

@forki forki commented Nov 15, 2018

@enricosada ideas?

@MarkNicholls

This comment has been minimized.

Copy link

@MarkNicholls MarkNicholls commented Nov 15, 2018

I have the same problem in an F# project, coincidentally after updating visual studio 2017 from 15.8.8 to 15.9.0.
My project targets
<TargetFramework>netcoreapp2.1</TargetFramework>

I have the problem in both Visual Studio AND the a fake build script (using MSBuild not dotnet)

I don't have the details here but I got

....Paket.Restore.targets(226,5): error : The provided SymbolPackageFormat value is invalid. Allowed values : 'snupkg', 'symbols.nupkg'.

my project compiles if
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
is not present (and presumably if its false).

it fails with the above error if "true"

I have no workaround except reverting to nuget, or presumably downgrading visual studio + tooling to 15.8.8

@forki

This comment has been minimized.

Copy link
Member

@forki forki commented Nov 15, 2018

do you guys have a zip with a repro?

@dbrattli

This comment has been minimized.

Copy link
Author

@dbrattli dbrattli commented Nov 15, 2018

Empty classlib dotnet new classlib with added Paket. https://github.com/dbrattli/PackFailure

@forki

This comment has been minimized.

Copy link
Member

@forki forki commented Nov 15, 2018

@forki

This comment has been minimized.

Copy link
Member

@forki forki commented Nov 15, 2018

ok I can repro - but I have no idea what's going on. it works with 2.1.403 but does not with latest .500 - ouch

@forki

This comment has been minimized.

Copy link
Member

@forki forki commented Nov 15, 2018

ok adding that property in the deps file fixes it for .500 but brekas it for older cli versions. sigh

image

forki added a commit that referenced this issue Nov 15, 2018
@forki

This comment has been minimized.

Copy link
Member

@forki forki commented Nov 15, 2018

so we need to find a way to detect if we are in .net 500 or earlier and duplicate the pack task yet another time. WIP in #3428

I added 2 ToDos - so if someone can try to come up with what needs to go there - I'd appreciate the help

@7sharp9

This comment has been minimized.

Copy link
Member

@7sharp9 7sharp9 commented Nov 15, 2018

Enrico is on honeymoon/holiday for a month.

@dbrattli

This comment has been minimized.

Copy link
Author

@dbrattli dbrattli commented Nov 15, 2018

Tried looking at the RuntimeFrameworkVersion but it's only set to 2.1 when not set explicitly.

@cartermp

This comment has been minimized.

Copy link
Contributor

@cartermp cartermp commented Nov 15, 2018

Is there an issue on the CLI for this? I'm not aware of any major changes to pack for 2.1.500

@NinoFloris

This comment has been minimized.

Copy link

@NinoFloris NinoFloris commented Nov 15, 2018

microsoft/msbuild#2350
$(MSBuildVersion) each msbuild version usually correlates to a version of the sdk as they're shipped and updated together.

@dbrattli

This comment has been minimized.

Copy link
Author

@dbrattli dbrattli commented Nov 15, 2018

MSBuildVersion=15.9.20 when run with 2.1.500. Notable New Features in 15.9. "We have improved the debugging experience for NuGet packages using the new symbol package format (.snupkg).". https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotes

@MarkNicholls

This comment has been minimized.

Copy link

@MarkNicholls MarkNicholls commented Nov 15, 2018

yeah I noticed that and thought it a bit of a coincidence.

@MarkNicholls

This comment has been minimized.

Copy link

@MarkNicholls MarkNicholls commented Nov 15, 2018

@forki is the message about addiing the property in the .deps file a workaround?
my choice at the moment really is remove paket completely or wait (I actually needed the MSBuild upgrade to make something else work)

@forki

This comment has been minimized.

Copy link
Member

@forki forki commented Nov 15, 2018

@cartermp

This comment has been minimized.

Copy link
Contributor

@cartermp cartermp commented Nov 15, 2018

Sounds like you need to add a check for the MSBuild version then. Though I'm generally worried that people on very old SDKs would still be using much newer Paket versions.

@forki

This comment has been minimized.

Copy link
Member

@forki forki commented Nov 15, 2018

@cartermp

This comment has been minimized.

Copy link
Contributor

@cartermp cartermp commented Nov 15, 2018

The implication here is that any project on an older SDK is likely to be using the very latest Paket, yes?

@forki

This comment has been minimized.

Copy link
Member

@forki forki commented Nov 15, 2018

@MarkNicholls

This comment has been minimized.

Copy link

@MarkNicholls MarkNicholls commented Nov 15, 2018

so just for advice to others, my workaround is to copy the paket.restore.targets and add SymbolPackageFormat line as described above and then amend my projects to import this amended file rather than the default one. Hopefully will get a fix and undo this, it only affects a few of my projects

forki added a commit that referenced this issue Nov 16, 2018
@forki

This comment has been minimized.

Copy link
Member

@forki forki commented Nov 16, 2018

I think I have a fix ready in #3428 - I'd appreciate review.

@forki forki closed this in 241ba2b Nov 16, 2018
@dbrattli

This comment has been minimized.

Copy link
Author

@dbrattli dbrattli commented Nov 16, 2018

Confirmed fixed in 5.189.0

@NinoFloris

This comment has been minimized.

Copy link

@NinoFloris NinoFloris commented Nov 16, 2018

So according to @dasMulli $(NETCoreSdkVersion) also exists!

@forki

This comment has been minimized.

Copy link
Member

@forki forki commented Nov 16, 2018

PR welcome if it improves things

@MarkNicholls

This comment has been minimized.

Copy link

@MarkNicholls MarkNicholls commented Nov 16, 2018

it worked for me!

@forki

This comment has been minimized.

Copy link
Member

@forki forki commented Nov 17, 2018

So apparently my fix wasn't good enough. #3429

Any ideas?

veminovici added a commit to veminovici/fraktaal that referenced this issue Nov 17, 2018
NOTE: There is an issue in paket when it tried to generate a nuget package. The work around is to add the line in tagerts file.

fsprojects/Paket#3427
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.