不同程序集的C#继承

问题描述:




我在程序集A中具有基本功能的A类。我不想改变这个项目。

i have class A in assembly A with base functionality. i don't want to alter in this project.

second 我在程序集B中有B类,其中B覆盖A的功能

second  i have class B in assembly B where B overrides functionality of A 

现在我想访问C语言中的A的属性/方法。

now i want to access Properties/method of A in Class C which is in Assembly C.

其中 我在C中添加了B的参考。

where  i had added reference of B in C.

我怎么能?

这取决于你想要什么。什么是C级?它是否继承自A / B?

It is depend on what you want. What is class C? Is it inherited from A/B or not?

如果要在C中使用A类,可以在C中添加对A的引用,但不能访问B类。如果你想在C中使用B,那么将添加程序集A,因为B使用它。 

When you want to use class A in C, you can add reference to A in C but class B will not be accessible. When you want to use B in C then assembly A will be added because B uses it.