我希望将应用程序使用的所有库(dll)放在一个子目录中(例如名为“lib”)。如何指示程序集加载器在特定目录中查找引用的程序集(该目录是主程序集存在的目录的子目录)?我认为这可以通过app.config中的一些设置来完成,对吗?
在你的app.config中使用探测路径。借用MSDN上的例子:<configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <probing privatePath="bin;bin2\subbin;bin3"/> </assemblyBinding> </runtime> </configuration>