动态添加程序集参考 [英] Add Assembly Reference Dynamically
问题描述
我有一个C#应用程序,它需要在引用中包含特定的dll,具体取决于客户端计算机.
I have a C# application which needs to have specfic dll in reference depends on the client machine.
例如,如果客户端使用版本2016.01,则我需要添加对具有版本2016.01的myLib.dll的引用,如果客户端使用版本2016.02,则需要对具有版本2016.01的myLib.dll添加引用2016.02
For example, if the client is using version 2016.01 then I need to add a reference to myLib.dll which has ver 2016.01 and if client is using version 2016.02 then I need to add a reference to myLib.dll which has ver 2016.02
请问我该怎么做?
谢谢
推荐答案
myLib.dll在哪里定位?
Where does myLib.dll locate?
您可以通过发布策略来重定向程序集版本.
You can redirect the assembly version by publishing policy.
请参考https://msdn.microsoft.com/zh-cn/library/7wd6ex19(v = vs.110).aspx
please refer to https://msdn.microsoft.com/en-us/library/7wd6ex19(v=vs.110).aspx
https://msdn.microsoft.com/zh-CN/library/dz32563a(v = vs.110).aspx
https://msdn.microsoft.com/en-us/library/dz32563a(v=vs.110).aspx
谢谢
这篇关于动态添加程序集参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!