Hello,
I have a control derived from a 3rd party control. My control sits in a
class library. I have an app referencing my class library. When I
compile the app, I'm told:
c:\pd\NET\Examp les\AssRef\AssR ef\bin\Debug\Mi ne.dll Referenced class
'Mine.Fred' has base class or interface 'Theirs.Flintst one' defined in an
assembly that is not referenced. You must add a reference to assembly
'Theirs'.
Here's some code to reproduce the behaviour:
// main app
using System;
using Mine;
namespace AssRef
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
Mine.Fred fred = new Fred();
}
}
}
// my class library
using System;
using Theirs;
namespace Mine
{
public class Fred : Theirs.Flintsto ne
{
public Fred()
{
}
}
}
// 3rd party control
using System;
namespace Theirs
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class Flintstone
{
public Flintstone()
{
}
}
}
In VS.NET create 2 class libraries and a console app, when you build the
solution, you'll get this:
c:\pd\NET\Examp les\AssRef\AssR ef\bin\Debug\Mi ne.dll Referenced class
'Mine.Fred' has base class or interface 'Theirs.Flintst one' defined in an
assembly that is not referenced. You must add a reference to assembly
'Theirs'.
Why? "Mine" already has an explicit reference to the "Theirs" DLL.
Thanks for any help,
..pd. 4 4496
Hello
Your app should also reference the 3rd party control's assembly.
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
".pd." <sp*****@your.p eril> wrote in message
news:Xn******** *************** ******@194.83.1 79.102... Hello,
I have a control derived from a 3rd party control. My control sits in a class library. I have an app referencing my class library. When I compile the app, I'm told:
c:\pd\NET\Examp les\AssRef\AssR ef\bin\Debug\Mi ne.dll Referenced class 'Mine.Fred' has base class or interface 'Theirs.Flintst one' defined in an assembly that is not referenced. You must add a reference to assembly 'Theirs'.
Here's some code to reproduce the behaviour:
// main app using System; using Mine;
namespace AssRef { class Class1 { [STAThread] static void Main(string[] args) { Mine.Fred fred = new Fred(); } } }
// my class library using System; using Theirs;
namespace Mine { public class Fred : Theirs.Flintsto ne { public Fred() { } } }
// 3rd party control
using System;
namespace Theirs { /// <summary> /// Summary description for Class1. /// </summary> public class Flintstone { public Flintstone() { } } }
In VS.NET create 2 class libraries and a console app, when you build the solution, you'll get this:
c:\pd\NET\Examp les\AssRef\AssR ef\bin\Debug\Mi ne.dll Referenced class 'Mine.Fred' has base class or interface 'Theirs.Flintst one' defined in an assembly that is not referenced. You must add a reference to assembly 'Theirs'.
Why? "Mine" already has an explicit reference to the "Theirs" DLL.
Thanks for any help,
.pd.
Dmitriy Lapshin [C# / .NET MVP] wrote on Fri 19 Dec 2003 02:28:56p: Your app should also reference the 3rd party control's assembly.
That's what the error message says and is indeed how to fix the problem.
But I don't understand why it *should* be a problem.
What I wanna know is why, when Theirs is not (directly) used by Main,
should Main require a reference to Theirs?
Mine has a reference to Theirs and therefore when control is passed to
Mine, the reference required to reach the referenced code in Theirs is
present.
Why does this stipulation exist? What justification is there for it? If
Mine.DLL was created to use Theirs.DLL, the developer of Mine made the
decision to use version n.n.n of Theirs. Users of Mine shouldn't need to
know that Mine makes calls to other assemblies - but if it should, then
why?
If a developer of Main now has to add a reference to Theirs to get Mine to
work, doesn't that then create a risk that s/he will reference the wrong
version of Theirs? What about transparency?
..pd.
Just because Mine has a reference to Theirs doesn't mean Mine contains
all the implementation and type declarations of Theirs. What if your app
needs to access base members in Flinstone? The app needs a reference to
Theirs so it can cast your Fred class as Flinstone, and execute the get/set
accessors (or whatever else) found in the Theirs assembly.
Erik
"Da5id" <sp*****@your.p eril> wrote in message
news:Xn******** *************** ******@194.83.1 79.102... Dmitriy Lapshin [C# / .NET MVP] wrote on Fri 19 Dec 2003 02:28:56p:
Your app should also reference the 3rd party control's assembly.
That's what the error message says and is indeed how to fix the problem. But I don't understand why it *should* be a problem.
What I wanna know is why, when Theirs is not (directly) used by Main, should Main require a reference to Theirs?
Mine has a reference to Theirs and therefore when control is passed to Mine, the reference required to reach the referenced code in Theirs is present.
Why does this stipulation exist? What justification is there for it? If Mine.DLL was created to use Theirs.DLL, the developer of Mine made the decision to use version n.n.n of Theirs. Users of Mine shouldn't need to know that Mine makes calls to other assemblies - but if it should, then why?
If a developer of Main now has to add a reference to Theirs to get Mine to work, doesn't that then create a risk that s/he will reference the wrong version of Theirs? What about transparency?
.pd.
Well, since C# has no notion of private inheritance like C++, all base
classes contribute methods, properties, etc. to your class. Thus the
compiler needs to see all metadata for the base types. Now if you used
containment rather than inheritance, that would be different. Then you
could successfully structure your assembly so that no clients would ever
need to directly reference your dependencies.
--
--Grant
This posting is provided "AS IS" with no warranties, and confers no rights.
"Da5id" <sp*****@your.p eril> wrote in message
news:Xn******** *************** ******@194.83.1 79.102... Dmitriy Lapshin [C# / .NET MVP] wrote on Fri 19 Dec 2003 02:28:56p:
Your app should also reference the 3rd party control's assembly.
That's what the error message says and is indeed how to fix the problem. But I don't understand why it *should* be a problem.
What I wanna know is why, when Theirs is not (directly) used by Main, should Main require a reference to Theirs?
Mine has a reference to Theirs and therefore when control is passed to Mine, the reference required to reach the referenced code in Theirs is present.
Why does this stipulation exist? What justification is there for it? If Mine.DLL was created to use Theirs.DLL, the developer of Mine made the decision to use version n.n.n of Theirs. Users of Mine shouldn't need to know that Mine makes calls to other assemblies - but if it should, then why?
If a developer of Main now has to add a reference to Theirs to get Mine to work, doesn't that then create a risk that s/he will reference the wrong version of Theirs? What about transparency?
.pd. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Peter Gomis |
last post by:
I have encountered a situation where I am unable to remove
a .NET assembly from the GAC. The message I receive
is "Assembly 'assemblyname' could not be uninstalled
because it is required by other applications." Although I
have seen this before when trying to remove .NET
assemblies that have been installed via an MSI package, I
now get this message while trying to remove any assembly
I've added to the GAC. Using gacutil does not work...
|
by: Matt Frame |
last post by:
I wrote a small assembly to test the process of placing it into the Global
Assembly Cache but now I cannot remove it. When I hi-light and click delete
I get the following:
Assembly 'Assembly Name' could not be uninstalled because it is required by
other applications.
I have signed on as the local administrator, I booted into safe mode and I
keep getting this message. Can you only put assemblies into the GAC? I
would assume if you...
|
by: nospam |
last post by:
Just wondering,
What do you think the difference in performance would be between
(1.) Compiled C#
(2.) Compiled C++
(3.) and Assembly Language
And how would the mix be if some if any of these languages had to hit
against a SQL Server database
|
by: Makarand Keer |
last post by:
Hi All
I have around 3 versions of same assembly installed in my GAC. Now I have to
un-install all these assem from GAC, for this I removed all the references to
these assem and called gacutil - u assname.
However it is not getting uninstalled, saying one or more applications are
using these assem.
Could anybody help me uninstalling these assem from GAC
Makarand
|
by: Greg Patrick |
last post by:
My problem:
I load an some assemblies (strong named) from a byte array using
Assembly.Load(byte). They load fine. But one one of them is actually
accessed, it's referenced assemblies can't be found on disk and I get a
TargetInvocationExeption.
For example, let's say I have a C# win forms application called Prog.
Prog.exe uses Assembly.Load(byte) to load two C# class library assemblies,
| |
by: Jim Bancroft |
last post by:
I'm having trouble using my VB class library in ASP.Net-- the webserver
gives following error when any component is created from my assembly. This
just started today (was fine on Friday):
----Access to the registry key
HKEY_CLASSES_ROOT\ClassLibrary01.TestObject.Test1 is denied.----
I can't figure out what's wrong; I've checked and rechecked the ASPNet user
account's security and group membership, done all manner of things (even
|
by: Diffident |
last post by:
Hello All,
I am trying to add an assembly to GAC but having difficult time figuring out
the concept of GAC. This is what I am trying to do....
1. Installed NUnit framework whose DLL ("nunit.framework.dll") I need to add
to the GAC so that I can use it from multiple applications.
2. Used the command "sn" to verify that the assembly is already strongly
named. Concluded that NUnit assembly is strongly named.
|
by: Atmapuri |
last post by:
Hi!
I have a C# project which references assembly myassembly.dll.
The project worked fine. Then I removed the reference from
the Reference list and added the assembly with the same name,
but an older version.
Regardless what I tried, I could not get the project reference
the new assembly. It constantly kept looking for the assembly
of the previous, as if though once added the assembly version
|
by: John Bailey |
last post by:
I have checked around and could not find anything here that exactly matches
my issue, which is odd since I have found numerous posts on this in other
news groups. I have a ASP .Net 2.0 site that is distributed as code (the
pages are not precompiled, but code behind is used). From time to time I get
the following error:
Could not load file or assembly 'App_Web_u2h48fgb, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null' or one of its...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |