probing要素


app.configのprobing要素でexeが参照するdllの位置を指定することができる


動作環境

・VS2005
・.NetFrameWork2.0



Testexe.exeがclass1.dllを参照しているケース


ディレクトリ構成

bin
|
|---Testexe.exe
|
|---Testexe.exe.config  
|
|---dll
     |---class1.dll     ←参照先DLL
       

※app.configファイルはexeと同じ名前とし、同じ階層に配置しておくこと



Test.exe.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<runtime>
		<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
			<probing privatePath="dll" />
		</assemblyBinding>
	</runtime>
</configuration>


参照するディレクトリはセミコロン区切りで複数設定することも可能。
ただし、exeより上の階層の指定はできない。