AgentSkillsCN

embedding-pdb-in-exe

将 PDB 调试符号嵌入 EXE/DLL 文件。适用于配置嵌入式调试符号、单文件部署、Source Link 集成,或 dotnet publish 设置时使用。

SKILL.md
--- frontmatter
name: embedding-pdb-in-exe
description: "Embeds PDB debugging symbols into EXE/DLL files. Use when configuring embedded debug symbols, single-file deployment, Source Link integration, or dotnet publish settings."

PDB Embedded Debugging Symbols

Embed PDB files into EXE/DLL for stack traces with source locations without separate symbol files.


Quick Start

xml
<PropertyGroup>
  <DebugType>embedded</DebugType>
</PropertyGroup>

Recommended Configuration

xml
<PropertyGroup>
  <DebugType>embedded</DebugType>
  <DebugSymbols>true</DebugSymbols>
  <Deterministic>true</Deterministic>
  <PathMap>$(MSBuildProjectDirectory)=.</PathMap>
</PropertyGroup>

Command Line

bash
# Build
dotnet build -c Release -p:DebugType=embedded

# Publish (single-file)
dotnet publish -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:DebugType=embedded

DebugType Options

OptionPDB LocationUse Case
fullSeparate fileDevelopment
pdbonlySeparate fileRelease (default)
portableSeparate fileCross-platform
embeddedInside EXEDistribution
noneNoneSecurity critical

Additional Resources