如何将.NET库移动到子目录?

Daw*_*hia 13 .net c#

我想把我的应用程序使用的所有库(dll)放到一个子目录中(让'说出名为"lib").如何指示程序集加载程序在该特定目录(存在主程序集的目录的子目录)中查找引用的程序集?

我认为它应该通过app.config中的一些设置完成,对吧?

Mar*_*ell 22

探测 app.config中的路径.借用MSDN中的示例:

<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <probing privatePath="bin;bin2\subbin;bin3"/>
      </assemblyBinding>
   </runtime>
</configuration>
Run Code Online (Sandbox Code Playgroud)