Adding modules from another project

B

Bill Nguyen

I would like to include a module from another project. When I added existing
item, VS copied the module to the current project's folder so that whatever
I did to this module doesn't reflect in the original module. this is NOT
what I expected.

Is there a way to share a module (.vb) among multiple projects?

Thanks

Bill
 
G

Guest

I believe you can add the module as a Project instead of a module. You can
have several projects within a solution and several solutions can share the
same project. The project is NOT copied to the current solution but remains
and whatever you do to it, changes it for all solutions using the same
project.
 
B

Bill Nguyen

Dennis;

Can you please elaborate on the following scenario:

Projects:

1. MasterSolution: in folder \VS2005\MASTER
This project contains module Master with Class MasterData wich in turn
contains Functions ReadData and UpdateData

2. XMLProject: in folder \VS2005\XML

This project needs to use both functions ReadData and UpdateData in
MasterSolution project.


What is the correct way to setup the solution to achieve this goal?

Thanks

Bill
 
G

Guest

Is there a way to share a module (.vb) among multiple projects?

Project
Add Existing Item
Browse to the file and select it
Click the dropdown gizmo to the right of the Open button
Link File

This is the way it works in .net 2003, I assume roughly the same in 2005. A
file is added normally in one project and then referenced as a link file in
other projects. Edits made to the file from any project are seen in all
projects.

I do this with one form file, two source files containing a few modules and
classes, and a few .wav and .ico files. They reside in a utility project
which contains test drivers for rigorous regression testing. All other uses
of these files are as link files in vb .net projects that create windows form
apps.

The alternative is a class library project referenced by the apps, but I am
satisfied with sharing code via source code link files.
 
B

Bill Nguyen

AMercer;

This seems to be working. Thanks a lot.

Now that I would like to create a startup form in MasterSolution to call the
Main form in other projects, how do I make sreference to these forms without
having to open them in MasterSolution as a link form. Would this be
possible?

Thanks

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top