tags:

views:

163

answers:

5

Hi,

Is there any way to add reference from one winforms to another winforms??

There are in another solutions

I don't wanna to create this class once again.

I don't see a dll in winform project.

A: 

No, you won't have a DLL - but you can still add a reference to the project. You can add references to EXE files as well as DLLs. IIRC, you couldn't in VS2003, but you can as of VS2005. (It's possible it was "no" in 2005 and "yes" in 2008 - you definitely can in 2008 though.)

Jon Skeet
A: 

you can just add a reference to the project. In the Add references dialog, select the projects tab.

You can also add references to .EXEs in the same way you would add references to dlls as well, if you don't want to put both projects in the same solution.

Sam Holder
No, he can't - they're in different solutions.
SLaks
beat my edit. he could add the project to both the solutions...
Sam Holder
+2  A: 

Right-click the project, click Add Reference, wait a long time, click Browse, then select the compiled EXE from the other project.

SLaks
+1  A: 

Create a new project from either the Class Library project template or the Windows Forms Control Library project template. The latter can be helpful if you create your own controls. The resulting DLL assembly can be referenced in used in other Windows Forms Application projects.

Using an EXE assembly as a project reference is possible, although I reckon most installers will get pretty confuzzled by it. You would have to deploy the EXE to the same directory as your "main" application EXE. Do it properly with a class library project.

Hans Passant
A: 

Something that is very helpful for adding references is PowerCommands Amongst other things it allows you to right-click a project and copy the reference, then paste this reference into another project.

JonC