Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi!

 

I have get a VB.NEt project. I add to this project my

C# project. I set my C# project as Startup. But me C# can't see the

VB.NEt project!

what I should do that my C# project can see the VB.NET project.

(now are the both projects in one solution).

 

 

gicio

Posted

the project isn't a .dll ...it's a .exe (it's a project with forms)

 

can I make a .dll from a project with forms?

 

when YES....HOW??

 

 

thx!

 

 

gicio

  • *Experts*
Posted
Just create a new Class Library project and copy all your code files into it, you shouldnt have any problems. Then when you do that, you can add a reference to that DLL from your other Windows Forms app.
  • 1 month later...
Posted
must have the both project the same namespace???

 

 

gicio

 

How to put both the projects in the same namespace.Please expalin clearly as i tried it but did not suceed.Urgent Requirement

 

Thanx

  • *Experts*
Posted

You don't really need them in the same namespace. Here's what you can do though.

 

Assuming you have Solution named Project1 with a project WinExe1. Also assume you have another solution with a project WinExe2. Now suppose you want the forms from WinExe2 to be available in WinExe1:

 

1. Open your solution for WinExe1 and right click the solution and select Add Existing project. Select your WinExe2 project.

2. Right click your WinExe2 project and click properties. Change the project type from Windows Executable to Class Library.

3. Expand the references node for WinExe1 and click Add Reference. Select the Projects tab and select the WinExe2 project.

 

Now in your WinExe1 project, add something like:

Imports WinExe2

to the top of one of your classes. Import whatever namespace you used in the second project. Now that class in WinExe1 should be able to create an object from WinExe2, including forms.

 

The two keys are keeping the projects in one solution and making sure the second project is a Class Library. You can always switch it back to a Windows Exe for testing separately later - I do that all the time.

 

-Ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...