question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet pack fails with paket and .NET Core 2.1.500

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:27 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
MarkNichollscommented, 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

0reactions
forkicommented, Nov 17, 2018

So apparently my fix wasn’t good enough. https://github.com/fsprojects/Paket/issues/3429

Any ideas?

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet pack command - .NET CLI
The dotnet pack command builds the project and creates NuGet packages. The result of this command is a NuGet package (that is, a...
Read more >
dotnet pack recently failing
NET Core SDK/runtime version is too old. The recommended solution is to add a UseDotNet task before your original tasks: - task: UseDotNet@2 ......
Read more >
Nuget restore fails on Azure Devops with message "unable ...
Tried specifying a specific version of nuget before the restore, without success .NET Core SDK latest version in the build agent is 2.1.500...
Read more >
Paket and the .NET SDK / .NET Core CLI tools (dotnet CLI ...
A dependency manager for .NET with support for NuGet packages and git repositories.
Read more >
Using .NET Core Tools to Create Reusable and Shareable ...
Dotnet Tools offer a simple way to create, publish and consume what are essentially .NET Core applications that can be published and shared ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found