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.

Azure DevOps .NET Core Publish fails when CSPROJ is configured for SourceLink

See original GitHub issue

Hi, I am trying to add sourcelink support to my .NET Standard C# project in Azure DevOps. I posted the issue to the VS developer community, but our Msft DevOps representative suggested I also post here. In short, if I add the following to the VCPROJ file the Azure DevOps .NET Core Publish step will fail:

<PublishRepositoryUrl>true</PublishRepositoryUrl> 
<EmbedUntrackedSources>true</EmbedUntrackedSources> 
<IncludeSymbols>true</IncludeSymbols> 
<SymbolPackageFormat>snupkg</SymbolPackageFormat> 

The publish step fails becasue it is trying to add two nupkg packages using the same identifier:

2019-01-15T20:52:18.6116399Z [command]"C:\Program Files\dotnet\dotnet.exe" nuget push D:\a\1\a\InsaneGenius.Utilities.1.1.20190115.11.nupkg --source https://pkgs.dev.azure.com/pieterv/_packaging/7865d2b7-317d-4b9d-8dbf-afde06073a5b/nuget/v3/index.json --api-key VSTS
2019-01-15T20:52:21.4033450Z info : Pushing InsaneGenius.Utilities.1.1.20190115.11.nupkg to 'https://pkgs.dev.azure.com/pieterv/_packaging/7865d2b7-317d-4b9d-8dbf-afde06073a5b/nuget/v2/'...
2019-01-15T20:52:21.4068772Z info :   PUT https://pkgs.dev.azure.com/pieterv/_packaging/7865d2b7-317d-4b9d-8dbf-afde06073a5b/nuget/v2/
2019-01-15T20:52:22.3381309Z info :   Accepted https://pkgs.dev.azure.com/pieterv/_packaging/7865d2b7-317d-4b9d-8dbf-afde06073a5b/nuget/v2/ 932ms
2019-01-15T20:52:22.3408346Z info : Your package was pushed.
2019-01-15T20:52:22.3634837Z [command]"C:\Program Files\dotnet\dotnet.exe" nuget push D:\a\1\a\InsaneGenius.Utilities.1.1.20190115.11.symbols.nupkg --source https://pkgs.dev.azure.com/pieterv/_packaging/7865d2b7-317d-4b9d-8dbf-afde06073a5b/nuget/v3/index.json --api-key VSTS
2019-01-15T20:52:22.9984864Z info : Pushing InsaneGenius.Utilities.1.1.20190115.11.symbols.nupkg to 'https://pkgs.dev.azure.com/pieterv/_packaging/7865d2b7-317d-4b9d-8dbf-afde06073a5b/nuget/v2/'...
2019-01-15T20:52:23.5035958Z info :   PUT https://pkgs.dev.azure.com/pieterv/_packaging/7865d2b7-317d-4b9d-8dbf-afde06073a5b/nuget/v2/
2019-01-15T20:52:23.8088034Z info :   Conflict https://pkgs.dev.azure.com/pieterv/_packaging/7865d2b7-317d-4b9d-8dbf-afde06073a5b/nuget/v2/ 299ms
2019-01-15T20:52:23.9430124Z error: Response status code does not indicate success: 409 (Conflict - The feed already contains 'InsaneGenius.Utilities 1.1.20190115.11'. (DevOps Activity ID: 53788075-2469-4437-A43E-5D2A254D2016)).
2019-01-15T20:52:26.4073627Z ##[error]Error: C:\Program Files\dotnet\dotnet.exe failed with return code: 1
2019-01-15T20:52:26.4083210Z ##[error]Packages failed to publish

Please see: https://developercommunity.visualstudio.com/content/problem/427996/net-core-publish-fails-when-using-sourcelink-or-sn.html

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
omghbcommented, Dec 17, 2019
1reaction
tmatcommented, Jan 15, 2019

I’m little bit confused. Is this really a VCPROJ, or is it actually C# project (.csproj)? Looks like the latter. In that case I think the problem is that you are trying to publish .snupkg to nuget feed hosted on Azure DevOps. .snupkg packages are currently only supported by NuGet.org.

Read more comments on GitHub >

github_iconTop Results From Across the Web

.NET Core Publish fails when using SourceLink or snupkg ...
Azure Native ISV Services .NET Core Publish fails when using SourceLink or snupkg NuGet Symbol formats in CSPROJ fileClosed - Fixed
Read more >
Azure Devops Build Pipeline SourceLink.Create ...
Hi I am getting the following error in my Azure Devops build pipeline on the '.NET Core Build' task.
Read more >
Producing Packages with Source Link - .NET Blog
Learn how to add Source Link to your packages, to make your users more productive while debugging.
Read more >
Azure DevOps SourceLink and Symbol Server with ...
I have a .NET Standard 2.0 TestSouceLink project with the following configuration in the .csproj :
Read more >
Azure devops .netcore fails but builds fine in visual studio
-- I get following error when building in azure devops or publish from VS to an Azure app service. Visual Studio builds it...
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