2
我有一個「common」項目。我們稱之爲:MyProject.Common 該項目有一個命名空間Serials.Licensing,其中包含一個類許可證,其中包含靜態變量。C#在另一個引用的不同合併程序集中的相同類型和命名空間
因此,這將是共同項目的結構:
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)他們自己的程序集
如果在一個新的項目(projectC)中,我同時引用dll A和dll B.會出現類許可證中靜態變量的問題(如衝突)嗎?
我很困惑,因爲我不知道,如果這兩個DLL中和DLL B就擁有自己的「上下文」或是否會有問題,因爲空間和類型是相同的許可類的靜態變量。
你試過了嗎? –
許可證的範圍是什麼?如果你使它內部有幫助嗎? –