当前位置:编程学习 > C#/ASP.NET >>

请问如何发布API装配文件(codeBase配置)

本人非IT专业,但热衷于用编程来简化工作流程,我有一个问题,想像各位高手请教,就是程序中引用第三方软件(EPLAN)的API,总是说找不到,然后查找到它的帮助文档,如下:
You can make sure, the API assemblies are loaded from the bin directory by different means:

This is the easiest way: You can just copy the executable of your offline application to the respective bin folder of the EPLAN version, which you want to use. 
The second way, is to publish the codebases of all needed API assemblies in the application config file. (An XML file, which is named like your executable with an additional extension .config., e.g. MyApplication.exe.config). The following code shows an example for the contents of such a config file. 
 

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Eplan.EplApi.Systemu" publicKeyToken="57aaa27e22f7b107" />
        <publisherPolicy apply="yes" />
        <codeBase version="1.0.0.0" href="file:////C:/program files/EPLAN/Electric P8/x.x.x/BIN/Eplan.EplApi.Systemu.dll" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Eplan.EplApi.AFu" publicKeyToken="57aaa27e22f7b107" />
        <publisherPolicy apply="yes" />
        <codeBase version="1.0.0.0" href="file:////C:/program files/Electric P8/x.x.x/BIN/Eplan.EplApi.Afu.dll" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Eplan.EplApi.Baseu" publicKeyToken="57aaa27e22f7b107" />
        <publisherPolicy apply="yes" />
        <codeBase version="1.0.0.0" href="file:////C:/program files/EPLAN/Electric P8/x.x.x/BIN/Eplan.EplApi.Baseu.dll" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Eplan.EplApi.DataModelu" publicKeyToken="57aaa27e22f7b107" />
        <publisherPolicy apply="yes" />
        <codeBase version="1.0.0.0" href="file:////C:/program files//EPLAN/Electric P8/x.x.x/BIN/Eplan.EplApi.DataModelu.dll" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Eplan.EplApi.HEServicesu" publicKeyToken="57aaa27e22f7b107" />
        <publisherPolicy apply="yes" />
        <codeBase version="1.0.0.0" href="file:////C:/program files/EPLAN/Electric P8/x.x.x/BIN/Eplan.EplApi.HEServicesu.dll" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Eplan.EplApi.GUIu" publicKeyToken="57aaa27e22f7b107" />
        <publisherPolicy apply="yes" />
        <codeBase version="1.0.0.0" href="file:////C:/program files/EPLAN/Electric P8/x.x.x/BIN/Eplan.EplApi.GUIu.dll" />
      </dependentAssembly>

    </assemblyBinding>


  </runtime>
</configuration>

其中第一种方法,我已经测试成功,但感觉需要把可执行文件和EPlan的DLL放在一起,不好,并希望使用第二种方法,其中那个XML配置文件已经创建好了,但不知如何对其进行处理,请能教导一下,在此非常感谢! --------------------编程问答-------------------- 怎么没人帮助啊?
补充:.NET技术 ,  .NET Framework
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,