LoginSignup
1
4

More than 1 year has passed since last update.

Visual Studioで単一ファイルとして発行する方法

Last updated at Posted at 2023-02-21

前書き

Visual Studioのデフォルトの設定で発行すると.dllやら.xmlやらたくさんのファイルが出来てしまい、配布時に つ[.exe] といった感じで渡せない。
どういう設定で単一ファイルを発行できるのか調べてみた。

本題

  • 発行の設定
    プロジェクト右クリック>発行 の画面から編集をクリック
    2023-02-21_13h20_58.png
    配置モードを「自己完結」に設定
    「単一ファイルの作成」にチェック
    2023-02-21_13h21_28.png

  • プロジェクトの設定
    プロジェクトをダブルクリック
    PropertyGroupに「IncludeNativeLibrariesForSelfExtract」設定を追加
    2023-02-21_13h21_54.png

コピー用

<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>

まとめ

これで作成されるファイル達が単一ファイル(.exe)にまとめられる

1
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
4