473,503 Members | 1,910 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.Framework). 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.Framework is needed in MyProject.B. Why is this? I
don't explicitly use anything from Gentle.Framework 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.Framework just
because MyProejct.A uses that framework for its implementation?

TIA,

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

Project PackageA.csproj:

Class ClassA.cs:

----------
| using System;
| using Gentle.Framework; /* 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.Framwork.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.Framework). 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.Framework is needed in MyProject.B. Why is this? I
don't explicitly use anything from Gentle.Framework 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.Framework 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.Framework as base classes or implements interfaces. In this case the
compiler needs to have reference to the Gentle.Framework assembly because
now you basically uses a class from Gentle.Framework 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.Framework 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*****@moeller-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.Framework). 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.Framework is needed in MyProject.B. Why is this? I
don't explicitly use anything from Gentle.Framework 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.Framework 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.Framework as base classes or implements interfaces. In this case the
compiler needs to have reference to the Gentle.Framework assembly because
now you basically uses a class from Gentle.Framework 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.Framework 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*****@moeller-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.Framework). 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.Framework is needed in MyProject.B. Why is this? I
don't explicitly use anything from Gentle.Framework 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.Framework 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
4221
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...
13
6911
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...
2
2295
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...
0
3520
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...
2
1844
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...
3
4384
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...
1
3150
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...
2
3089
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:...
1
10881
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...
0
7205
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
7093
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
7467
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
5021
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
4685
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
3175
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
3166
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
397
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...

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.