Click here to Skip to main content
15,901,205 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i get a form of another project?

There are 2 projects in the same solution.project1 is referenced to the 2nd project(so that i can access forms of project1 from project2)

But i need to access the forms of project2 from project1?since i have all ready given the reference of project1 to project2 it does not allow me to create another reference between those projects.

Please help me to solve this problem!!

-thank you-
Posted
Updated 26-Oct-11 23:28pm
v2

You seem to have a design-issue here.
If your forms must be shared amongst several projects, just create them in one project that you will reference in other projects.
You definitely can't cross-reference projects ; you have to redesign your solution and place shared objects in one place, not everywhere.
 
Share this answer
 
This is a sure sign that your high level design is wrong. If those two projects are really so intertwined that they need two way references, then they should probably be rolled into one. More likely, you need to perform some separation of interests and determine interfaces that represent what you actually need within the lower level project.

Sharing UI elements (particularly forms) between projects is a big red flag. If you think you want that in both directions between two projects, those two projects are almost certainly really part of one.
 
Share this answer
 
You're running into a circular dependency between the two projects. You can remedy this by putting everything that needs to be referenced by both projects int a separate third project.
 
Share this answer
 
If cross-references are allowed, the project never could be compiled ;)
(Since A uses B and B uses A, you can't create A without B and the other way round)

Why do you split your forms into different projects?
Typically you have several business-logic projects and one GUI project (or more when you want to support multiple technologies like Console-Application, Windows Forms or WPF).

Beside this you could create a third project which references project1 and project2 and use this as entry-point.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900