powertools-lambda-dotnet icon indicating copy to clipboard operation
powertools-lambda-dotnet copied to clipboard

Maintenance: Improve debugging experience

Open hjgraca opened this issue 1 year ago • 0 comments

Summary

A good debugging experience relies on the presence of debug symbols as they provide critical information like the association between the compiled and the source code, names of local variables, stack traces, and more. You can use symbol packages (.snupkg) to distribute these symbols and improve the debugging experience of your NuGet packages. Symbol package isn't the only strategy to make the debug symbols available to the consumers of your library. It's also possible to include the PDB in the main NuGet package.

Why is this needed?

Allow Powertools users to be able to debug into the utilities

Which area does this relate to?

Other

Solution

There are two approaches:

  • Include debug symbols directly in the nuget package by adding a property to csproj
    • Pros:
      • No need to push to Nuget symbol server
      • Supports all IDEs
      • No extra downloads
    • Cons
      • Increases nuget package size
  <PropertyGroup>
    <AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
  </PropertyGroup>  
  • Creating a symbols package
    • Pros
      • Does not impact the size of the nuget package
    • Cons
      • Some limitations
      • Possible to not be available on all IDEs
<PropertyGroup>
    <IncludeSymbols>true</IncludeSymbols>
    <SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

Acknowledgment

hjgraca avatar Jul 05 '23 15:07 hjgraca