473,657 Members | 2,411 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Indirect assembly references

I've got a solution with two projects. One of those (namespace
MyProject.A) is using a library (e.g. Gentle.Framewor k). The other
(namespace MyProject.B) is only using classes from MyProject.A.

When compiling the stuff, I get an error message saying that an assembly
reference to Gentle.Framewor k is needed in MyProject.B. Why is this? I
don't explicitly use anything from Gentle.Framewor k from within
MyProject.B. Shouldn't the idea of Packages be to hide information about
the implementation. Why has MyProject.B to link to Gentle.Framewor k just
because MyProejct.A uses that framework for its implementation?

TIA,

Henning.
Nov 29 '05 #1
3 4060
To make it a little clearer... I've got to project files, the first one
being dependent only from a library (Gentle.Framewo rk), the second one
being dependent only from the first one.

Project PackageA.csproj :

Class ClassA.cs:

----------
| using System;
| using Gentle.Framewor k; /* with reference */
|
| namespace MyProject.A
| {
| /* using Gentle framework */
| }
----------

Project PackageB.csproj :

Class ClassB.cs

---------
| using System;
| using MyProject.A; /* with reference */
|
| namespace MyProject.B
| {
| /* using classes from MyProject.A */
| }
----------

My question:

Why do I have to reference the "Gentle.Framwor k.dll" from within
PackageB.csproj ?

Henning Möller schrieb:
I've got a solution with two projects. One of those (namespace
MyProject.A) is using a library (e.g. Gentle.Framewor k). The other
(namespace MyProject.B) is only using classes from MyProject.A.

When compiling the stuff, I get an error message saying that an assembly
reference to Gentle.Framewor k is needed in MyProject.B. Why is this? I
don't explicitly use anything from Gentle.Framewor k from within
MyProject.B. Shouldn't the idea of Packages be to hide information about
the implementation. Why has MyProject.B to link to Gentle.Framewor k just
because MyProejct.A uses that framework for its implementation?

TIA,

Henning.

Nov 29 '05 #2
Henning,

Not always, though. It happens when MyProject.A use classes from
Gentle.Framewor k as base classes or implements interfaces. In this case the
compiler needs to have reference to the Gentle.Framewor k assembly because
now you basically uses a class from Gentle.Framewor k is part of the
declaration of a class in MyProject.A.

Look at it this way - if in MyProject.B you wan to instantiate some class
declared in Gentle.Framewor k and you didn't add a reference to it, the
compiler will complain and you will add this reference without saying a
word. The situation is almost the same - now you don't isntantiate this
class directly, but it is instantiated as part of the class declared in
MyProject.B so you need to add reference to assembly(ies) for all base
classes and intefaces.

HTH

Stoitcho Goutsev (100) [C# MVP]

"Henning Möller" <he*****@moelle r-mingers.de> wrote in message
news:dm******** **@online.de...
I've got a solution with two projects. One of those (namespace
MyProject.A) is using a library (e.g. Gentle.Framewor k). The other
(namespace MyProject.B) is only using classes from MyProject.A.

When compiling the stuff, I get an error message saying that an assembly
reference to Gentle.Framewor k is needed in MyProject.B. Why is this? I
don't explicitly use anything from Gentle.Framewor k from within
MyProject.B. Shouldn't the idea of Packages be to hide information about
the implementation. Why has MyProject.B to link to Gentle.Framewor k just
because MyProejct.A uses that framework for its implementation?

TIA,

Henning.

Nov 29 '05 #3
Thanks for this insight.

You're right, this is kind of reasonable. And in fact, I've got to
consider my inheriting the technology classes (Gentle) in the business
logic layer a design flaw. I'll change that to aggregation instead. That
saves me from those additional references.

Cya,
Henning.

Stoitcho Goutsev (100) [C# MVP] schrieb:
Henning,

Not always, though. It happens when MyProject.A use classes from
Gentle.Framewor k as base classes or implements interfaces. In this case the
compiler needs to have reference to the Gentle.Framewor k assembly because
now you basically uses a class from Gentle.Framewor k is part of the
declaration of a class in MyProject.A.

Look at it this way - if in MyProject.B you wan to instantiate some class
declared in Gentle.Framewor k and you didn't add a reference to it, the
compiler will complain and you will add this reference without saying a
word. The situation is almost the same - now you don't isntantiate this
class directly, but it is instantiated as part of the class declared in
MyProject.B so you need to add reference to assembly(ies) for all base
classes and intefaces.

HTH

Stoitcho Goutsev (100) [C# MVP]

"Henning Möller" <he*****@moelle r-mingers.de> wrote in message
news:dm******** **@online.de...
I've got a solution with two projects. One of those (namespace
MyProject.A ) is using a library (e.g. Gentle.Framewor k). The other
(namespace MyProject.B) is only using classes from MyProject.A.

When compiling the stuff, I get an error message saying that an assembly
reference to Gentle.Framewor k is needed in MyProject.B. Why is this? I
don't explicitly use anything from Gentle.Framewor k from within
MyProject.B . Shouldn't the idea of Packages be to hide information about
the implementation. Why has MyProject.B to link to Gentle.Framewor k just
because MyProejct.A uses that framework for its implementation?

TIA,

Henning.


Nov 30 '05 #4

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

Similar topics

2
4238
by: Christopher Burns | last post by:
Hi all, We are using VB.NET (VS2K3), sitting on VSS6. I have sorted out a configuration problem that was preventing us from building from scratch for new developers, but now I am having a very odd references problem. Here is the scoop. I will make this brief, and if more info is needed please let me know... I don't want to ramble, as the details are vast. :) There are 3 projects involved in this issue, and it appears to be a...
13
6928
by: ganeshb | last post by:
Hi, What C statement(s) would translate to indirect jmp in assembly? I know that function pointer invocation would translate to indirect 'call' instruction, but I am not sure what will lead to indirect jmp (eg. jmp <register>). Ganesh
2
2305
by: Brad | last post by:
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...
0
3533
by: Eric Barr | last post by:
I saw a small number of old threads about a strange build error, but never saw a solution. I just spent about 4 hours debugging this so i hoped i could help out people who come across this problem by posting a solution. Anyway, here is what i was experiencing and how i fixed it ... The Build Error: Project '<projectname>' makes an indirect reference to assembly '<assemblyname>' which contains '<classname>'. Add a reference to...
2
1873
by: john | last post by:
Maybe I haven't had that "a-ha" moment yet, but I think the new approach to web projects is a step in the wrong direction. My main beef is that control over the assembly generation process has been taken away from us! I also don't agree with the logic behind a web site not having a project file, but I'll save that for another thread! Here's our scenario: We have a web project that runs in a non-managed sharepoint directory. The web...
3
4395
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here really understand how this could be an issue. The assemblies that the system is complaining about are ones that we build here and we're not changing version numbers on anything. The errors come and go with no apparent rhyme or reason. We do not...
1
3166
by: Richard Lewis Haggard | last post by:
I'm having a problem with what appears to be some sort of confusion with references. I have a single solution with a dozen projects which has been working quite nicely for a while. The references between projects in the solution were established through project references, not by browsing to an assembly DLL. All of the projects are strongly named and use key files. Each project's AssemblyInfo.cs specifies the assembly version, where the...
2
3097
by: misogsk | last post by:
Hi all, can someone help with to handle this error: BC32206: Indirect reference is being made to assembly ? Code i used was written in ASP.NET 1.1 and I run it on ASP.NET 2.0. The error code: <asp:label id="lbl_start" runat="server" text='<%#TimeZoneInformation.FromUniversalTime(userObject.TimeZoneID,Convert.ToDateTime(DataBinder.Eval(Container.DataItem, "window_Start")))%>'>
1
10892
by: jonathan184 | last post by:
Hi I amtrying to move over a website to another server. On the old hosting the site works fine. but when i transferred the site i am getting this error: Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Description: An error occurred during the compilation of a resource required to service...
0
8399
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8827
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
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 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...
1
8504
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,...
1
6169
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4159
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...
0
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1622
bsmnconsultancy
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...

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.