将.Net应用程序依赖的库文件部署到其他目录下

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weiwei_c/article/details/49727483

以程序:ReferenceClass.exe为例,引用myClass.dll;

1.程序编译成功后会生成ReferenceClass.exe.config文件;

2.打开ReferenceClass.exe.config文件,configuration元素下增加节点

    <runtime>
    <gcConcurrent   enabled="true"   />
    <assemblyBinding   xmlns="urn:schemas-microsoft-com:asm.v1">
      <publisherPolicy   apply="yes"   />
      <probing   privatePath=".\myClass"   />
    </assemblyBinding>
  </runtime>

3.在ReferenceClass.exe目录下新建文件件,把myClass.dll移到myClass文件夹中

4.至此大功告成!



资料:

https://msdn.microsoft.com/zh-cn/library/yx7xezcf(v=vs.80).aspx

http://www.csharpwin.com/csharpspace/9839r5399.shtml


猜你喜欢

转载自blog.csdn.net/weiwei_c/article/details/49727483