473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Problem with Inheritance across assemblies...

I'm trying to extend System.Web.Mail.MailMessage in my own class. Let's
call it Company.Common.MailMessage. My project obviously has a reference to
System.Web.dll - in order to inherit from MailMessage.

If I build my Company.Common assembly, reference it from a new application
and attempt to consume Company.Common.MailMessage, I receive the following
compile error:

Reference required to assembly 'System.Web' containing the base class
'System.Web.Mail.MailMessage'. Add one to your project.

Kinda makes sense, but not really. Why doesn't my assembly know where to
find System.Web? It's in the GAC and the reference is to a specific
version, culture, etc. I've tried setting "Copy Local" to true for the
System.Web reference in my Company.Common assembly - no luck.

This is analogous to three people in a car - the driver needs directions, so
he asks the person in the passenger seat. He doesn't know where we're
going, but says that the guy in the backseat does. Why can't the driver
just ask the guy in the backseat without taking his eyes off of the road, of
course)? They're all in the same car!

I suspect it has something to do with Namespace boundaries or code access
security, but am not sure. If there isn't a trick to use
Company.Common.MailMessage in an application without a reference to
System.Web, perhaps there's a trick to getting my application to
automatically add a reference to System.Web when I add a reference to
Company.Common?

Thanks!
Ron.
Nov 20 '05 #1
0 918

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

Similar topics

14
by: Axel Straschil | last post by:
Hello! Im working with new (object) classes and normaly call init of ther motherclass with callin super(...), workes fine. No, I've got a case with multiple inherance and want to ask if this...
18
by: George Sakkis | last post by:
I'm looking for a design to a problem I came across, which goes like this (no, it's not homework): 1. There is a (single inheritance) hierarchy of domain classes, say A<-B<-..<-Z (arrows point...
0
by: Eric Johnson | last post by:
I have a class and a sub-class (InstrumentationType.Abstract & InstrumentationType.Instance). If I make these declarations in one assembly, WMI CIM Studio shows the inheritance correctly. That is...
6
by: Brendan Jurd | last post by:
Hi all, I read on the manual page for Inheritance that: "A limitation of the inheritance feature is that indexes (including unique constraints) and foreign key constraints only apply to single...
0
by: JKJ | last post by:
I'm not an OOP guru, but I would say ". . .not necessarily" What if the base class and derived classes are internal? Then the base class has to be within the same assembly to be inherited from. ...
4
by: anders | last post by:
I already asked this question in the VB.NET group but as C# seems to have the same problem, I'll try here, too. I have 2 external OEM assemblies A1 and A2 that both define class X (same name,...
3
by: Chris Kennedy | last post by:
What's the difference between importing a namespaces and inheriting.
5
by: rkozlin | last post by:
Running into an issue where the compiler will throw an error... "The type '<BaseClass>' is defined in an assembly that is not referenced. You must add a reference to assembly '<BaseClass>'." ...
3
by: navyliu | last post by:
I have raised a discussion about assembly unloading.But we can't get a final solution. Since we cannot unlaod a assembly,Is there any reference about this indicate that this problem won't make...
2
by: Shilpa | last post by:
Hi All, I am creating an add-in for some third party tools A and B. The add-in has a single GUI that is used in both A and B. The add-in is build by referencing dlls from A and B. The problem...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.