【发布时间】:2014-04-25 09:34:43
【问题描述】:
我有一个“普通”项目。我们称之为:MyProject.Common 该项目有一个命名空间 Serials.Licensing,其中包含一个类 License带有静态变量。
所以这将是公共项目的结构:
MyProject.Common (dll)
| -> Serials.Licensing (namespace)
| -> License (class with static variables)
使用 IlMerge,我将此程序集合并到两个不同的程序集(A.dll、B.dll)中。这将是使用 IlMerge 创建的 2 个程序集的结果:
assemblyA (dll)
| -> Serials.Licensing (namespace)
| -> License (class with static variables)
| class "classA" using the License class of this dll
还有
assemblyB (dll)
| -> Serials.Licensing (namespace)
| -> License (class with static variables)
| class "classB" using the License class of this dll
如您所见,两个程序集都有类(classA、classB),它们使用合并到自己程序集中的 License 类
如果在一个新项目(projectC)中,我同时引用了dll A和dll B。License类中的静态变量会不会有问题(比如冲突)?
我很困惑,因为我不知道 dll A 和 dll B 是否都有自己的“上下文”,或者是否会因为命名空间和类型与 License 类的静态变量相同而出现问题。
【问题讨论】:
-
许可证的范围是什么?如果你把它做成内部的,那有帮助吗?
标签: c# types namespaces ilmerge