I have a project that I publish to Azure Artifacts:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<DebugType>portable</DebugType>
<Version>1.0.11</Version>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.AzureRepos.Git" Version="1.1.1" PrivateAssets="All"/>
</ItemGroup>
</Project>
Now I also want to publish the appropriate symbols in order to debug that package. Thus I followed the instructions from https://learn.microsoft.com/azure/devops/pipelines/artifacts/symbols?view=azure-devops#publish-portable-pdbs-to-azure-artifacts-symbol-server. My pipeline contains this:
steps:
... omited for brevity
- task: DotNetCoreCLI@2
inputs:
command: 'build'
projects: '**/*.csproj'
arguments: '--configuration Release'
- task: DotNetCoreCLI@2
inputs:
command: 'pack'
packagesToPack: '**/*.csproj'
nobuild: true
includesymbols: true
versioningScheme: 'off'
- task: DotNetCoreCLI@2
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: 'myfeed'
- task: PublishSymbols@2
inputs:
SearchPattern: '**/bin/**/*.pdb'
IndexSources: false
SymbolServerType: 'TeamServices'
When I debug my consuming app, that references the package, and take a look into the currently loaded modules, I see my package with its symbols being loaded. However When I step into any of its types, just nothing happens and debugger steps to the next line of my consuming app.
This are my VS-settings for Debugging:
As you can see "Just my code" is disabled, and "Source link support" as well as "Source server support" are enabled.
I also tried to set the DebugType
of my project to embedded
, in order to embed the PDB into the assembly. However that didn't change anything. The symbols are loaded, but somehow SourceLink isn't able to get the information from them.
EDIT: my package is deployed with Release
-configuration, instead of Debug
.