B
Brad
I have one of those seemingly simple questions that evades/confuses me.
I've created an assembly with bass classes (classes meant to be inherited in
other assemblys). In a secondary assembly (my business layer) I created a
class which inherits from a base class in the first assembly....so far so
good.
If I create a third assembly (my UI layer) and add reference in it to the
business layer and I access a public variable in the business layer...and
that variable is from the bass class I get an error in the UI like
'<name>' is declared in project '<projectname1>', which is not referenced by
project '<projectname2>'
To resolve this I have to add a reference in the UI to the base class so the
UI assembly now has a reference to the base class *and* the inherited class.
My question is: Why? I wouldn't have expected to need a reference to the
base class.....I would think the UI wouldn't have to know anything about the
base class.
Oddly enough even though there is an error message and the UI assembly won't
compile (without a ref to the base class) intellitype still shows me all the
base class public members and interfaces that are in the inherited class.
Example:
=========================
Assembly A
Public Class MyAClass
Public var1 as string
End Class
==========================
Assembly B (which references A)
Public Class MyBClass: Inherits MyAClass
End Class
==========================
Assembly C (which references B)
B.MyBClass.var1
Error Message is:
"var1 is declared in project A.dll which is not referenced by project C.dll"
But even with error intellitype shows .var1
Thanks
Brad
I've created an assembly with bass classes (classes meant to be inherited in
other assemblys). In a secondary assembly (my business layer) I created a
class which inherits from a base class in the first assembly....so far so
good.
If I create a third assembly (my UI layer) and add reference in it to the
business layer and I access a public variable in the business layer...and
that variable is from the bass class I get an error in the UI like
'<name>' is declared in project '<projectname1>', which is not referenced by
project '<projectname2>'
To resolve this I have to add a reference in the UI to the base class so the
UI assembly now has a reference to the base class *and* the inherited class.
My question is: Why? I wouldn't have expected to need a reference to the
base class.....I would think the UI wouldn't have to know anything about the
base class.
Oddly enough even though there is an error message and the UI assembly won't
compile (without a ref to the base class) intellitype still shows me all the
base class public members and interfaces that are in the inherited class.
Example:
=========================
Assembly A
Public Class MyAClass
Public var1 as string
End Class
==========================
Assembly B (which references A)
Public Class MyBClass: Inherits MyAClass
End Class
==========================
Assembly C (which references B)
B.MyBClass.var1
Error Message is:
"var1 is declared in project A.dll which is not referenced by project C.dll"
But even with error intellitype shows .var1
Thanks
Brad