dotnet / sourcelink

Source Link enables a great source debugging experience for your users, by adding source control metadata to your built assets
MIT License
1.25k stars 122 forks source link

Only works with -c Debug (.net core, azure repo, azure artifacts) #248

Open timker opened 5 years ago

timker commented 5 years ago

So far I can get symbols working, but only when in Debug Configuration. I'm worried that performance will be reduced.

I don't think I can use .snupkg because it's not supported by Azure DevOps Artifacts, so I'm embedding the pdb in the package

so I've been emdedding the pbd

   <EmbedUntrackedSources>true</EmbedUntrackedSources>
    <PublishRepositoryUrl>true</PublishRepositoryUrl>
    <AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <DebugType>full</DebugType>
    <DebugSymbols>true</DebugSymbols>
  </PropertyGroup>

I'm also using "Index Sources & Publish Symbols" task in Azure Pipeline which looks to be working an uploading

steps:
- task: PublishSymbols@2
  displayName: 'Publish symbols path'
  inputs:
    SymbolServerType: TeamServices

In Debug mode the pdb generated is significantly larger than in release mode. The dll is about the same, but I'm worried that the compiler won't apply optimizations in Debug mode, so the dll performance will be degraded.

tmat commented 5 years ago

Setting DebugType to full switches to Windows PDBs, which are considerably larger and limited to Windows OS. The default for project that import Microsoft.Net.Sdk is portable.

Do you use a Azure symbol server when debugging (VS configuration in Debug > Options > Symbols)?

timker commented 5 years ago

Yes, We are using Azure Symbol server. The PublishSymbols@2 task will upload to Azure Symbol

I've also removed full, and it's going with portable, but still only in Debug mode

As soon as I set it Configuration to Release, build and push the new package version, the project that references the package will stop asking to download source versions when debugging