LoginSignup
4
5

More than 1 year has passed since last update.

C#.NETのexeでdllファイルを別フォルダーにまとめる

Last updated at Posted at 2022-12-19

概要

dll多くなるとビルド先が ↓ こんな風になっちゃう。
image.png
「exeどこやねん…」ってなっちゃう。

↓ こういう風にすっきりさせたい。
image.png
(dllファイルはbinフォルダーにまとめる)

ビルドイベント

ビルド時のフォルダー作成やdllファイルの移動については下記。

exeの設定

ただdllファイルをまとめるだけではダメ。(exe実行時に例外)
『dllファイルがどこにまとまってるか』を設定ファイルに書いてあげる必要あり。

App.configを作成して....
image.png

App.configに…
image.png

下記追加。

<probing privatePath="bin" />

追加する場所(階層)は ↓ ここ。
image.png

dllをまとめるフォルダーは『bin』以外の名前でもOK。

参考サイトさん

バージョン

Windows 10 Pro 21H2 OSビルド 19045.2364
Microsoft Visual Studio Community 2022 Version 17.4.2
VisualStudio.17.Release/17.4.2+33122.133
Microsoft .NET Framework Version 4.8.04084

4
5
5

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
4
5