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

publishing-wpf-apps

指导WPF应用程序的发布和安装选项。当用户提到发布、部署、发布、打包或安装程序时,使用此指南来帮助选择部署方法和安装程序技术。

person作者: jakexiaohubgithub

WPF Application Publishing Guide

When publishing WPF applications, ask the user about deployment and installer preferences.


Ask User: Deployment Method

Which deployment method do you need?

  1. Framework-Dependent - Small size (~1MB), requires .NET runtime
  2. Self-Contained - Includes runtime (150-200MB), no dependencies
  3. Single-File - One executable (50-80MB compressed)

Ask User: Installer Technology

Which installer/update technology do you prefer?

  1. Velopack (Recommended) - Modern, fast updates, delta updates
  2. MSIX - Windows Store, enterprise deployment
  3. NSIS - Traditional installer, full control
  4. Inno Setup - Simple, widely used
  5. None - Portable/xcopy deployment

Quick Reference

Deployment Methods

| Method | Size | Startup | Requirements | |--------|------|---------|--------------| | Framework-Dependent | ~1MB | Fast | .NET runtime | | Self-Contained | 150-200MB | Fast | None | | Single-File | 150-200MB | Medium | None | | Single-File + Compressed | 50-80MB | Slower | None |

Installer Technologies

| Technology | Auto-Update | Delta Updates | Store | Complexity | |------------|-------------|---------------|-------|------------| | Velopack | ✅ | ✅ | ❌ | Low | | MSIX | ✅ | ✅ | ✅ | Medium | | NSIS | Manual | ❌ | ❌ | High | | Inno Setup | Manual | ❌ | ❌ | Medium |


WPF Limitations

⚠️ PublishTrimmed: Not supported (reflection-heavy) ⚠️ PublishAot: Not supported (WPF incompatible)


Basic Commands

# Framework-Dependent
dotnet publish -c Release

# Self-Contained
dotnet publish -c Release -r win-x64 --self-contained true

# Single-File (WPF)
dotnet publish -c Release -r win-x64 --self-contained true \
  -p:PublishSingleFile=true \
  -p:IncludeNativeLibrariesForSelfExtract=true

Additional Resources