如何在C#项目中引用两个同名的不兼容程序集? [英] How can I reference two identically named, incompatible assemblies in my C# project?

查看:438
本文介绍了如何在C#项目中引用两个同名的不兼容程序集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,我需要引用来自不同硬件供应商的两个程序集(MercuryAPI.dll和Impinj.OctaneSDK.dll).每个程序集都引用LLRP.dll的自定义版本.与MercuryAPI.dll一起使用的LLRP版本是1.0.0.6版 而与Impinj.OctaneSDK.dll兼容的版本是10.22.0.30.每个LLRP.dll的自定义阻止了我像在StackExchange和其他地方那样简单地使用绑定重定向,因为在每个自定义后它们不兼容 小贩.

In my project I need to reference two assemblies from different hardware vendors (MercuryAPI.dll and Impinj.OctaneSDK.dll). Each of those assemblies references a customized version of LLRP.dll. The LLRP version that works with MercuryAPI.dll is version 1.0.0.6 while the version that works with Impinj.OctaneSDK.dll is 10.22.0.30. The customization of each LLRP.dll prevents me from simply using a binding redirect as I've found on StackExchange and other places, as they are not compatible after customization by each vendor.

我如何告诉VisualStudio在MercuryAPI引用时使用版本1.0.0.6,在OctaneSDK引用时使用版本10.22.0.30?显然,我需要在构建后"操作中将它们放在单独的文件夹中,但是我不清楚如何重定向每个文件夹 组装(Mercury或Octane)为其特定的LLRP.dll.

How do I tell VisualStudio to use version 1.0.0.6 when referenced by MercuryAPI and to use version 10.22.0.30 when referenced by OctaneSDK? Obviously I'll need to put them in separate folders in a Post Build action, but I'm not clear on how to redirect each assembly (Mercury or Octane) to their specific LLRP.dll.

谢谢!

推荐答案

一种可行的方法是为2个供应商构建两个exe项目(在exe的app.config文件),并在调用指定的函数时调用指定的exe.

A feasible way is that you build two exe project for the 2 vendors(configure the reference path in the app.config file for the exe), and call specified exe when you call specified function.

谢谢


这篇关于如何在C#项目中引用两个同名的不兼容程序集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆