Multiple Executables in one project

kaybenleroll

New member
Joined
Jul 12, 2006
Messages
4
Programming Experience
Beginner
I have developed a project using Visual Basic 2005 Express Edition.

I would now like to modify the project so that it creates a number of different executables (since there will be a significant amount of overlap between the different programs.

Is this possible? Or do I need a more advanced IDE?
 
Last edited by a moderator:
A single Project will only produce a single executable or library file, but a Solution may contain several projects. You could for instance in one solution have two windows application projects and one class library projects. Both winapps can reference this same class library. Other class files and forms can't be shared, you see this if you Add Existing these files are copied into each distict project. You can choose different build options for the projects in solution properties. By default the solution explorer in VB2005 show the project as the top treenode, you can add new or existing projects to the solution from main menu File > Add new/existing. If you do this you will see the solution as the new top treenode in solution explorer with each project listed below as childs.
 
As an example, i have a project that is a client, server, com interface for legacy apps, web interface, viewer program for the server etc. They all operate via remoting, so the same objects are remoted back and forth and the database access is the same. It is managed as one big solution with 7 projects in it. One project, called Common has all the commonly used compoennts. Each app refernces Common just like any other DLL, and can use the common compoennts. The advantage is you can see and step into the source code. Common (and some other projects) compile to a DLL so we end up with 4 exe and 3 DLLwhen a build is run

Choose File.. New project, and then tick the option to add it to the existing solution. It will have its own namespace so if you call it MyCommon, then in MyApp, you'll say imports MyCommon; or qualify usage:
Dim x as MyCommon.SomeCommonClass;

Just like you would for most the .net framework classes like e.g. System.Text.RegularExpressions
 
A class library in different project (of same development solution) still also need to be referenced with the Add Reference dialog, but you should now be able to choose it from the Projects tab in dialog. Then you can import the namespace or qualify the type with the namespace when you use it.
 
Back
Top