Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2004

Tip: Looking for answers? Try searching our database.

Circulat dependency

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tal - 30 May 2004 14:56 GMT
I am having assembly A with reference to assembly B and B need reference to
A. The IDE does not allow it because of circular dependency. How can I solve
it (when i cannot change existing code in A or B).
Niki Estner - 30 May 2004 16:56 GMT
> I am having assembly A with reference to assembly B and B need reference to
> A. The IDE does not allow it because of circular dependency. How can I solve
> it

Put them both in one assembly, or make a third assembly that contains
classes used by both, but using none of the other classes.

> (when i cannot change existing code in A or B).

You can hardly solve problems without any change...

Niki
Bruno Jouhier [MVP] - 31 May 2004 17:15 GMT
> I am having assembly A with reference to assembly B and B need reference to
> A. The IDE does not allow it because of circular dependency. How can I solve
> it (when i cannot change existing code in A or B).

If A and B cross reference each other, you cannot compile them. So, it seems
very strange that you cannot change existing code in A or B because this
seems to indicate that someone gave you source code that does not compile
and prevented you from changing it! This does not make much sense.

You have to eliminate the cross references. And the only way to do it is to
change the code!

Bruno.
Nick Holmes - 31 May 2004 17:35 GMT
I agree that the situation seems absurd, but I like a challenge, and so I
think it is possible to fix without changing A or B.

All you need to do is add a new assembly that wraps (say) A using
reflection/late binding, and drop this dll into the reference point that B
is using.

I can't imagine why you would ever actually want to inflict this on
yourself, but it would work...

Nick.

> > I am having assembly A with reference to assembly B and B need reference
> to
[quoted text clipped - 11 lines]
>
> Bruno.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.