返回 Skill 列表
extension
分类: 开发与工程无需 API Key

embedding-pdb-in-exe

将PDB调试符号嵌入到EXE/DLL文件中。在配置嵌入式调试符号、单文件部署、Source Link集成或dotnet发布设置时使用。

person作者: jakexiaohubgithub

PDB Embedded Debugging Symbols

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


Quick Start

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

Recommended Configuration

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

Command Line

# 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

| Option | PDB Location | Use Case | |--------|--------------|----------| | full | Separate file | Development | | pdbonly | Separate file | Release (default) | | portable | Separate file | Cross-platform | | embedded | Inside EXE | Distribution | | none | None | Security critical |


Additional Resources