How can I share code between projects w/o creating a class library?

B

Brad Wood

Using VS2003, I can't add an existing class to a project w/o the IDE
creating a copy of it.
I want multiple projects to be able to share a central copy of a class.

I can't compile the shared class into a library because one of the
executables that uses the class needs to be a self contained executable
that will be downloaded and immediately executed on a PDA.

I can't GAC the shared library so that both applications can use it
because my deployment model is limited to "OTA" - simple downloads of
cab files and I don't think I can GAC something using the standard
cabwiz cab file builder.

I tried to use AL.exe to link my shared library to the executable that
needs to be self contained but I can't even begin to figure out how to
use that tool (I think I have to create "modules" - don't even know what
they are).

The simplest way is if I could just share the code without VS forcing me
to make local copies......
 
G

Guest

Create a shared code project with all the classes you want to share located
there
In another project that wants to use the shared code:

Project
Add Existing Item
Browse to your shared code
select the file you want
Click the down arrow to the right of the Open Button
Select Link File

That will add the shared file to your project as a link (not a copy). If
you make changes to the file, then all other projects that link to the shared
file will see the changes. Ok?
 
B

Brad Wood

Brad said:
Using VS2003, I can't add an existing class to a project w/o the IDE
creating a copy of it.

To answer my own question for the benefit of others, I didn't realize
the "Open" button in the add existing item had a drop down next to it
with an option titled "Link file".
 

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