471,339 Members | 1,246 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,339 software developers and data experts.

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

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......
Jul 21 '05 #1
2 2551
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?

"Brad Wood" wrote:
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......

Jul 21 '05 #2
Brad Wood wrote:
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".
Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by ad | last post: by
8 posts views Thread by William Meitzen | last post: by
4 posts views Thread by moondaddy | last post: by
1 post views Thread by Viviana Vc | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.