dotnet / dotnet/sourcelink

Create end to end documentation for Sourcelink with Azure Devops

Open
#943 1 comment 7 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.4k
Forks
148
PR merge metrics
No merged PRs in 30d

Description

We are using the whole Azure DevOps suite and would like to use SourceLink for our internal NuGet packages.
Those packages are stored in Azure DevOps artifacts and the source code is stored in Azure DevOps Repos.
We build the packages with Azure DevOps pipelines.

There is no complete documentation on how to get this to work end to end and i have not been able to get it to work.

From what i have gathered so far:

- Reference Microsoft.SourceLink.AzureRepos.Git
- Set the properties described here: https://github.com/dotnet/sourcelink#using-source-link-in-net-projects
``` xml
true


true


true
snupkg
```
- Embed PDBs into the nuget package as Artifacts does not support `.snupkg` files
- Everthing else should happen automagically

Neither `dotnet build` (With `GeneratePackageOnBuild=true`) nor `dotnet pack` produce nuget packages with a set repository url.

Our current build step looks like this (With GeneratePackageOnBuild=true):
``` yaml
- task: DotNetCoreCLI@2
displayName: 'Build master'
condition: ne(variables['Build.Reason'], 'PullRequest')
inputs:
command: 'build'
projects: '${{ parameters.solutionFolder }}/${{ parameters.applicationFolder }}'
arguments: '--configuration $(buildConfiguration)'
```
What i have notices that packages build with Visual Studio produce nuget packages with valid source link information.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.