【问题标题】:How to define custom path to Interop *.dll如何定义 Interop *.dll 的自定义路径
【发布时间】:2011-01-10 13:26:03
【问题描述】:

嗯,

我有一个 ActiveX (*.ocx) 组件,我在 托管 C++/CLI 项目中使用它:围绕 ActiveX 组件编写托管包装器[NET 有一个很棒的互操作服务:为我提供了生成的 dll,所以我可以很容易地在我的托管代码中使用它]

问题是 Visual Studio (2008) 自动将 生成的 Interop *.dll 复制到 我的 *.exe 文件所在的目录。但我想把所有我生成的 Interop *.dll 到一个文件夹...

假设我的目录结构是这样的:

D:\MyProject\Output\MyProject.exe //我管理的 exe

D:\MyProject\Output\Interop.XXXLib.1.0.dll // *Interop .dll

我想把 Interop.XXXLib.1.0.dll 放到新文件夹中

D:\MyProject\Output\Interops

并从该目录中使用它...我该怎么做?

最好的祝福

PS:

到目前为止,我发现在我的 app.config 文件中使用 codeBase/ 探测标签,例如

<?xml version="1.0"?>
<configuration>
  <runtime>
     <assemblyBinding xmlns="urn:schemas-microsoft-com.asm.v1">
        <probing privatePath="Interops" />
     </assemblyBinding>
  </runtime>
</configuration>

但我没有在 C++/CLI 中工作

【问题讨论】:

    标签: dll interop managed-c++


    【解决方案1】:

    修复它... Visual Studio 2008 C++/CLI 自动创建名为 app.config 的配置文件。我用程序集名称 MyProject.exe.config 更改了这个名称,现在它可以工作了......我认为有一个 隐藏约定 assembly.dll.configassembly.exe.config 我不知道的命名模式...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-26
      • 2011-01-16
      • 2023-03-19
      • 1970-01-01
      • 2019-11-19
      • 1970-01-01
      相关资源
      最近更新 更多