473,505 Members | 16,800 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Expose a Class from a Referenced Assembly

All,

I'm wondering if anyone can help with a small little issue I'm having.

Here's the hypothetical situation:

I have an Assembly called FooBaseAssembly with a classed called
FooBase.

I have another Assembly called FooMaster which has a reference to
FooBase.

I want to expose the FooBase class (or a subclass of it, I really don't
care) from FooMaster without requiring the developer to have to
reference FooBase.

Bascially, I want the developer to be able to add a reference to the
the FooMaster class ONLY (and not have to worry about FooBase), but
have access to the FooBase class as well.

I've tried creating a subclass in FooMaster (like FooBaseSubclass :
FooBase), but when I try to compile code which references FooMaster and
creates a FooBaseSubclass I get a compiler error "FooBase is defined in
an assembly that is not referenced. You must add a reference to
assembly FooBase".

Does C# support this type of arrangement? Or does it need a reference
to each and every single base class exposed from a subclass?

Any help would be greatly appreciated!

Nov 17 '05 #1
2 2153
Or does it need a reference
to each and every single base class exposed from a subclass?


Yes, for things like Intellisense to work.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 17 '05 #2
I have tried for awhile to get a situation like this to work with little
success. Think of it as a cascade effect. If you reference
ChildAssembly.Class1 that inherits from MasterAssembly.Class1, then you
must have a reference to ChildAssembly and MasterAssembly for the
complier to properly link it all.

Hmmm, kind of reminds me of DLL hell all over again. lol ;-)

HTH,
~d

jh******@gmail.com wrote:
All,

I'm wondering if anyone can help with a small little issue I'm having.

Here's the hypothetical situation:

I have an Assembly called FooBaseAssembly with a classed called
FooBase.

I have another Assembly called FooMaster which has a reference to
FooBase.

I want to expose the FooBase class (or a subclass of it, I really don't
care) from FooMaster without requiring the developer to have to
reference FooBase.

Bascially, I want the developer to be able to add a reference to the
the FooMaster class ONLY (and not have to worry about FooBase), but
have access to the FooBase class as well.

I've tried creating a subclass in FooMaster (like FooBaseSubclass :
FooBase), but when I try to compile code which references FooMaster and
creates a FooBaseSubclass I get a compiler error "FooBase is defined in
an assembly that is not referenced. You must add a reference to
assembly FooBase".

Does C# support this type of arrangement? Or does it need a reference
to each and every single base class exposed from a subclass?

Any help would be greatly appreciated!

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1273
by: Fred Herring | last post by:
I work in vb.net and utilize some functionality which is based upon some external classes which I currently reference in my application. These external classes all contribute to a single area of...
0
1619
by: keith | last post by:
I created a custom control class which inherted from another control class in C#. The another control referenced another assembly. I put the custom control into toolbox and drew it into a form...
1
1487
by: Jimi | last post by:
(Sorry for the repost, but I thought maybe I'd have better luck this time) I'm working on a utility to provide an overview of one's .NET projects and one of the things I want to display is...
1
1559
by: C | last post by:
Hi, I have a class withing my ASP.Net project which I want other applications to use so I am going to create a separate Assembly for this. In addition to this I want to know if it is possible...
1
7079
by: Jim | last post by:
Have fully operational software package developed on VB.NET that worked until Jan 1 2003, with early stage deployments on Oct 10, Oct 23, Nov 11, Dec 12 and Dec 30. When attempted final...
6
4880
by: cipher | last post by:
I have some constant values in my web service that my client application will require. Having to keep server side and client side definitions insync is tedious. I am trying to do something like...
14
5400
by: Jamey Shuemaker | last post by:
Greetings all, I've been reading for the last couple hours posts on this site and various MS sites about reference libraries and class modules. System: Windows 2K running an A2K db with...
5
6759
by: Jesper Schmidt | last post by:
When does CLR performs initialization of static variables in a class library? (1) when the class library is loaded (2) when a static variable is first referenced (3) when... It seems that...
5
9642
by: =?Utf-8?B?TWFuaQ==?= | last post by:
Hi, I have a webservice which uses a c# Dll,This Dll is a C# class library which contain few class . I am able to see the class when in the Web service but when i create a stubb class of the...
0
7218
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7103
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7307
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7478
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5035
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4701
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.