作者:curzz | 来源:互联网 | 2023-05-26 15:42
IhaveassemblyAwithclassZthatinheritsfromclassXinassemblyB.Nowinacompletelydiffere
I have assembly A with class Z that inherits from class X in assembly B. Now in a completely different solution, I have assembly C, which uses class Z.
我有程序集A和类Z,它继承自程序集B中的类X.现在在一个完全不同的解决方案中,我有程序集C,它使用类Z.
The compiler complains unless assembly C has a reference to both assembly A & B. Even though assembly C does not use class Z directly in anyway.
除非程序集C具有对程序集A和B的引用,否则编译器会抱怨。即使程序集C无论如何都不直接使用类Z.
Is this expected?
这是预期的吗?
It seems to me that if assembly B is missing at run time stuff blows up, but at compile time it shouldn't care.
在我看来,如果程序集B在运行时丢失,那么东西会爆炸,但在编译时它应该不在乎。
What am I missing here?
我在这里想念的是什么?
My goal is that I can tell my clients to depend on class Z in assembly A, but I can completely reconfigure my assemblies on the other side and have no effect at all on the client when they upgrade.
我的目标是我可以告诉我的客户端依赖于程序集A中的类Z,但我可以在另一端完全重新配置我的程序集,并且在升级时对客户端完全没有影响。
2 个解决方案