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

Create end to end documentation for Sourcelink with Azure Devops #943

Open
anhaehne opened this issue Jan 25, 2023 · 0 comments
Open

Create end to end documentation for Sourcelink with Azure Devops #943

anhaehne opened this issue Jan 25, 2023 · 0 comments

Comments

@anhaehne
Copy link

anhaehne commented Jan 25, 2023

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:

    <PublishRepositoryUrl>true</PublishRepositoryUrl>
 
    <!-- Optional: Embed source files that are not tracked by the source control manager in the PDB -->
    <EmbedUntrackedSources>true</EmbedUntrackedSources>
  
    <!-- Optional: Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
    <IncludeSymbols>true</IncludeSymbols>
    <SymbolPackageFormat>snupkg</SymbolPackageFormat>
  • 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):

    - 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant