473,387 Members | 1,379 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,387 software developers and data experts.

Circular Reference - Command Line Compile?

Lex
How can I compile two classes from the command line that reference each other?

Class A referenced Class B and Class B references Class A.

Regards
Nov 15 '05 #1
3 1407
Lex <de**@homerlex.mailshell.com> wrote:
How can I compile two classes from the command line that reference each other?

Class A referenced Class B and Class B references Class A.


csc [...] ClassA.cs ClassB.cs

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #2
Two classes in same project?
There shouldn't be any problem.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

"Lex" <de**@homerlex.mailshell.com> wrote in message
news:c5*************************@posting.google.co m...
How can I compile two classes from the command line that reference each other?
Class A referenced Class B and Class B references Class A.

Regards

Nov 15 '05 #3
Lex,
If class A & Class B are separate projects, I would recommend the Separated
Interface pattern.

http://www.martinfowler.com/eaaCatal...Interface.html

Project C would define Interface C that is implemented by Class A and
consumed by Class B. Project A would Reference Project B & C, while Project
B would only reference Project C. When Class A created an instance of Class
B it would pass its 'this' as Interface C.

The others have indicated how to if they are in the same projects.

Remember that the GC will correctly clean up both objects if no other
objects are referring to them other then themselves...

Hope this helps
Jay

"Lex" <de**@homerlex.mailshell.com> wrote in message
news:c5*************************@posting.google.co m...
How can I compile two classes from the command line that reference each other?
Class A referenced Class B and Class B references Class A.

Regards

Nov 15 '05 #4

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

Similar topics

2
by: John E. | last post by:
How can I compile two projects with a circular reference while giving them a strong name? There is a project that we have that has two components that reference each other e.g. A<->B thus...
2
by: Zippy | last post by:
Some months ago, we requested help from this newsgroup on how to replace the library reference of a database with another library reference, prior to creating an MDE. I got the following answer...
6
by: T Koster | last post by:
After a few years of programming C, I had come to believe that I finally knew how to correctly organise my structure definitions in header files for mutually dependent structures, but I find myself...
2
by: Mike | last post by:
I ran into a problem with circular dependencies. My code looks somthing like: using B namespace A { class formA { void foo() {
1
by: Lex | last post by:
How can I compile two classes from the command line that reference each other? Class A referenced Class B and Class B references Class A. Regards
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)...
5
by: Madhur | last post by:
Hello If I define two classes in the same cs file. And in each class, I define the object of other class as a member. Can anyone explain me how .NET or its compiler will resolve this kind of...
3
by: =?Utf-8?B?UGF1bCBIYWxl?= | last post by:
Moving all User Controls to a single directory has solved my problem - Thanks Eliyahu. That said, I still got one Circular ref error yesterday, rebuilt again and the build was fine? Far far...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.