473,785 Members | 2,435 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Circular References in Visual Studio

Visual Studio doesn't allow circular references between projects. I have a
situation where I need to allow 2 projects to reference each other.
Is there any way to make Visual Studio allow this?

I realize the best way is to restructure the solution so the circular
reference isn't necessary, which I intend to do. But at the moment, I'm
looking for a quicker work-around if there is one.
Thanks....
Keith F.
Nov 18 '05 #1
3 2905
Nope. Look at the problem a little closer and you'll see why.

Say you have projects A and B.

A needs something from B and B needs something from A.
A is compiled first, so it goes and grabs the contents of B as it is linked.
In this process it checks B for any dependencies and finds A. As a result
it grabs the contents of A and looks for dependencies and finds B... See
where this is headed?

Same reason if you have two classes C and D. And C is a child of D, that is
C inherits D. D cannot also inherit C. This is sort of the same idea.

Inheritance / references are simply ways of reusing code. What I would
suggest is putting these reused controls in a separate 'class library' then
have both A and B reference the new library L.

HTH

"Keith F." wrote:
Visual Studio doesn't allow circular references between projects. I have a
situation where I need to allow 2 projects to reference each other.
Is there any way to make Visual Studio allow this?

I realize the best way is to restructure the solution so the circular
reference isn't necessary, which I intend to do. But at the moment, I'm
looking for a quicker work-around if there is one.
Thanks....
Keith F.

Nov 18 '05 #2
Do not reference project.

Reference compiled DLL.

It will be a quick workauround.
George
My Site - Body Jewelry
"Keith F." <Keith F.@discussions. microsoft.com> wrote in message news:22******** *************** ***********@mic rosoft.com...
Visual Studio doesn't allow circular references between projects. I have a
situation where I need to allow 2 projects to reference each other.
Is there any way to make Visual Studio allow this?

I realize the best way is to restructure the solution so the circular
reference isn't necessary, which I intend to do. But at the moment, I'm
looking for a quicker work-around if there is one.
Thanks....
Keith F.
Nov 18 '05 #3
George has an interesting solution which will work, but "working" is a
relative term here. You could end up consuming resources if you truly run
circles.

One other possibility, which adds a bit of weight, but can add a safety
measure, is creating a passthrough class with the method signatures
necessary from the other project. Realize that true circular references will
still be dangerous, even with a passthrough class, if you do not add a
safety net if it starts running in circles.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** ***
Think Outside the Box!
*************** *************** *************** ***
"Keith F." <Keith F.@discussions. microsoft.com> wrote in message
news:22******** *************** ***********@mic rosoft.com...
Visual Studio doesn't allow circular references between projects. I have a
situation where I need to allow 2 projects to reference each other.
Is there any way to make Visual Studio allow this?

I realize the best way is to restructure the solution so the circular
reference isn't necessary, which I intend to do. But at the moment, I'm
looking for a quicker work-around if there is one.
Thanks....
Keith F.

Nov 18 '05 #4

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

Similar topics

1
7269
by: angelag | last post by:
I am currently taking a college course in Visual Basic.Net and I am a beginner. I bought Visual Studio.Net 2003 to do my homework at home. I built my first project and e-mailed it to myself at school. When I tried to open it in the lab, I got a message saying I couldn't open it because it was created with a newer version. Evidently the lab is using Visual Studio.Net 2002. My professor doesn't just want the executable file, he wants...
3
5653
by: Christine McGavran | last post by:
I have created an xml format for describing a custom user interface. My application successfully parses and displays the UI described in xml files created in that format. Before today we were using Visual Studio .net 2002. I created a schema file to describe my xml so that I could use the fancy xml editing capabilities in the Visual Studio enviroment. With this schema referenced, I could auto-complete while scripting xml for my user...
2
7984
by: Earth Worm Jim | last post by:
I have been able to get simple circular references to be serialized in xml by using the ImportTypeMapping method on the SoapReflectionImporter class. But I am unable to serialise circular references when the circular reference is contained with in a collection class, specifically I am using a custom ArrayList object. I keep getting a StackOverFlow Exception from the XmlSerializer class when attempting the serialisation. The classes...
65
19058
by: xuanbai98 | last post by:
I want to know the current support status of c99 on Microsoft Visual Studio. Anyone know whether Microsoft has any plan to support c99 on Visual Studio? Thanks, Xuan
26
10884
by: Bruno Jouhier [MVP] | last post by:
I'm currently experiencing a strange phenomenon: At my Office, Visual Studio takes a very long time to compile our solution (more than 1 minute for the first project). At home, Visual Studio compiles the same solution much faster (about 10 seconds for the first project). My home computer is only marginally faster than the one I have at the office (P4 2.53 vs. P4 2.4, same amount of RAM). On the slow machine, the CPU usage is very low,...
12
7064
by: Frank Rizzo | last post by:
I have a circular reference between 2 classes in the same project (i.e. each class refers to the other). The app runs fine and I am seeing no issues, which kind of surprised me. Are there any issues that I am not seeing (performance wise or garbage collection wise) with circular references? Thanks.
6
5081
by: Stephen Robertson | last post by:
We are currently in a dead end with a circular reference issue using vb.net, and are hoping someone might help us resolve it. Idea... We have frmmain calling frmperson (dim f as new frmperson) in search (no record) mode. When the search is executed, frmperson calls frmsearchresult (dim f as new frmsearchresult) which is a listing of persons. From frmsearchresults, frmperson is called (dim f as new frmperson) with the resulting...
2
2826
by: Lapu-Lapu | last post by:
I have authored a web service using ASP 2.0. The web services return objects that use generics and that also contain circular references. Programmatically, everything works well, as long as you use the web service proxy client generated by visual studio. However, the default test harness provided by the .asmx file errors out because it seems to use XmlSerialization and cannot handle circular references. I understand that the...
1
1210
balabaster
by: balabaster | last post by:
I have a database with two main tables, we'll call them A and B. The relationship between the two main tables is by nature a many-to-many relationship, so to normalize and avoid the many-to-many relationship, I've got a third table that joins relevant records of table A to table B, we'll call this one c. So here I get to the tricky part and I wondered how most people got around this. I've got 2 classes in my project, one to represent table A...
0
9480
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,...
0
10325
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
10147
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
10091
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,...
0
8972
agi2029
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...
1
7499
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
5381
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.