473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 2677
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.