472,983 Members | 2,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,983 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 2649
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Newbee Adam | last post by:
anyone have any secrets or pearls about vb.net you want to share I was asked by my company to begin teach an introductory VB.Net course 2 day seminar. I had been teaching an sql server 2000...
16
by: ad | last post by:
I have write a clss, say DM.cs, and I save it in a independent directory like c:\MyUtil I have a new project in c:\proj1. When I use VS to add the existed c:\MyUtil\DM.cs to the new project,...
8
by: William Meitzen | last post by:
Does someone know how I can get two projects to share a common class? Something like this: solution WholeShmeer project1 code1 CommonClass project2 code2 CommonClass
4
by: moondaddy | last post by:
I have some pubic Enums I like to use throughout my application. Now I'm parsing the application out into smaller DLLs or projects. How an I share a common Enum across all the projects? ...
2
by: Brad Wood | last post by:
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...
15
by: Neo | last post by:
Hello All, I found that ASP.net website only accepts code withing site directory. This creates big hurdle in shairng code. How to share code between two websites, like the way share between two...
1
by: Viviana Vc | last post by:
Hi all, I have "Visual Studio Team Suite" subscription and now I started to play with Visual Studio 2005 for creating Test Projects. The thing I am interested in is the "unit test". I tried...
2
by: Paul | last post by:
I have a class that references/consumes a webservice, and I would like to split that class into a base class to be used as a based for classes in each of two class libraries/DLLs. I have...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.