gicio Posted August 15, 2003 Posted August 15, 2003 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 Quote
*Gurus* divil Posted August 15, 2003 *Gurus* Posted August 15, 2003 Go to the usual Add Reference dialog, then select the Project tab at the top. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
gicio Posted August 15, 2003 Author Posted August 15, 2003 the project is there! but how I can declare it? to see it in C# ? gicio Quote
gicio Posted August 15, 2003 Author Posted August 15, 2003 must have the both project the same namespace??? gicio Quote
*Experts* mutant Posted August 15, 2003 *Experts* Posted August 15, 2003 You cannot declare projects, if one of them is a DLL then you can add a reference to the compiled DLL from another one. Quote
gicio Posted August 15, 2003 Author Posted August 15, 2003 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 Quote
*Experts* mutant Posted August 15, 2003 *Experts* Posted August 15, 2003 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. Quote
Administrators PlausiblyDamp Posted August 15, 2003 Administrators Posted August 15, 2003 You can't set a reference to an .EXE in .Net only Dlls. If you create a classlibrary you add forms to it in the same way you would to an .EXE project. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
gdhooper Posted September 17, 2003 Posted September 17, 2003 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 Quote
*Experts* Nerseus Posted September 17, 2003 *Experts* Posted September 17, 2003 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 Quote "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
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.