Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Global module

Status
Not open for further replies.

lennynuts

Programmer
Oct 12, 2006
9
GB
I am trying to have a global module I can use in several projects. I have created it but when I add it to a project as a new item it creates a completely new copy of the module instead of using the existing one. Have I missed something ?

Thanks,
Len
 
Instead of adding the project, what if you compiled the project you wanted to add then added the DLL or EXE as a reference?
 
Im actually trying to add a module to a project. In vb6 you could add an existing module to a number of projects and they all used the same copy of the module. Thats what Im trying to do, but vb.Net seems to create a new copy of the module for each project.
 
make a new project.

Add it to your solution

and then add a reference to the "Project" from your project. when doing add reference you have several tabs one of them is projects. and voila.

Christiaan Baes
Belgium

"My new site" - Me
 
You could also create a class library and just reference it in your projects.
 
I would recommend the project references like Chrissie mentioned.

Make a single new class library project. Add all of your code/classes to it.

Open your other solutions, right click on the solution explorer, click Add -> existing project. Add the project that you created before. Right click on any other projects in your solution and select "Add References". Jump to the "Projects" tab and select the project that you just added.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
If need be, you can always add a dll and have ilmerge build a single executable at the end of the build.

Brian Begy
BugSentry - Automatic error reporting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top