473,385 Members | 1,824 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,385 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 2676
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.