473,383 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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 2880
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**********************************@microsof t.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**********************************@microsof t.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
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...
3
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...
2
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...
65
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
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...
12
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...
6
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)...
2
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...
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.