Visual Studio 操作

C#打包时第三方库放到一个子目录中

步骤1:添加引用,浏览到需要的dll目录中,选择dll添加

双击app.config文件,

在configuration节点中添加

<runtime>

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

<probing privatePath="pal" />

</assemblyBinding>

</runtime>

 

如果有多个子文件夹,两个地址用“;”隔开,如<probing privatePath="lib;bin;config/user"/>

在exe目录中建立pal文件夹,将需要的dll复制到这里。

原文地址:https://www.cnblogs.com/noigel/p/14387828.html