473,387 Members | 1,535 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,387 software developers and data experts.

Share source files among projects?

Is it possible to share a single source file among two or more Projects in a
Solution?

I'm not talking about a DLL, just a .vb file that might contain a class or
module with common code to be compiled into each project. That way this
code can be updated once instead of makiing duplicate changes to identical
code within each project.

I have tried putting the source in a common folder, then using Add Existing
Item to add it to each project, but that creates a separate copy of the file
in each project folder. Then I'm back to keeping changes syncronized
manually.

I have been searching VB.NET help and newsgroups, but either this can't be
done or I am asking the wrong questions.

thanks

Dick
Nov 20 '05 #1
5 2026
* "Richard K" <ju******@seventree.com> scripsit:
Is it possible to share a single source file among two or more Projects in a
Solution?


Add the file to the 2nd project by opening the "Add Existing File..."
dialog and choosing "Reference" from the dropdown of the "Add" button.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
"Richard K" <ju******@seventree.com> schrieb

It is sufficient to post the question once. :-)
Is it possible to share a single source file among two or more
Projects in a Solution?

When the "add file" dialog is open, select the file to be linked to the
project, then click on the arrow on the right side next to the "open"
button. In the opening menu, select "link" (or whatever it is called in the
English version).
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
Sorry, I don't seem to be following...

When I right click on the project in Solution Explorer, then hover on the
Add line, then pick Add Existing Item from the submenu - I get an Add
Existing Item dialog. But any file selected from outside the project folder
gets phyically copied to the project folder.

In the project right-click menu there is also Add Reference, but that dialog
only allows DLL's to be selected.

Am I doing something wrong here?

Dick

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bq*************@ID-208219.news.uni-berlin.de...
* "Richard K" <ju******@seventree.com> scripsit:
Is it possible to share a single source file among two or more Projects in a Solution?


Add the file to the 2nd project by opening the "Add Existing File..."
dialog and choosing "Reference" from the dropdown of the "Add" button.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #4
I didn't intend for it to be posted 5 times - but Outlook Express kept
telling me the send process had failed so I kept retrying...

But your advice was good, I think I finally understand this.

thanks

Dick

"Armin Zingler" <az*******@freenet.de> wrote in message
news:uO**************@TK2MSFTNGP10.phx.gbl...
"Richard K" <ju******@seventree.com> schrieb

It is sufficient to post the question once. :-)
Is it possible to share a single source file among two or more
Projects in a Solution?

When the "add file" dialog is open, select the file to be linked to the
project, then click on the arrow on the right side next to the "open"
button. In the opening menu, select "link" (or whatever it is called in

the English version).
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #5
* "Richard K" <ju******@seventree.com> scripsit:
Sorry, I don't seem to be following...

When I right click on the project in Solution Explorer, then hover on the
Add line, then pick Add Existing Item from the submenu - I get an Add
Existing Item dialog. But any file selected from outside the project folder
gets phyically copied to the project folder.


Select the file and choose the "Reference"/"Link File" button from the
dropdown of the dialog's default button.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tim Zhao | last post by:
I downloaded the PHP 5 source code from www.php.net web site. It is a tar compressed file. I used WinZip to unzip it. Now I got a whole bunch of files. But I do not know to read these files. Do...
3
by: thxBruin | last post by:
I have a Class CTest in test.cs but two or more projects need this class. So how to share the SOURCE FILE(test.cs, not using dll file) in these projects?
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,...
1
by: Macca | last post by:
Hi, I have a C# Solution/Application that contain 4 projects. Each of these projects needs at some time to access the same database. I would like to know how to share a single connection...
1
by: Bill Reynen | last post by:
Hello, Working in ASP.NET. I want to create several projects on the web server /Online /Online/App1 /Online/App2 /Online/App3
0
by: Richard K | last post by:
Is it possible to share a single source file among two or more Projects in a Solution? I'm not talking about a DLL, just a .vb file that might contain a class or module with common code to be...
3
by: Ron L | last post by:
I have an application that I am developing that is a front end for a SQL database. We will also be developing a subset of the UI that will work as a (mainly) standalone client that will make a...
9
by: moondaddy | last post by:
I'm using asp.net 2.0 and c# and would like to share some user control between several websites. these websites are on the same server and have a physical location right next to each other like...
2
by: Magnus Bergh | last post by:
I have a solution which contains multiple projects (different applications). Every project use the same typed dataset (and also a few other shared code files). I tried to remove the dataset.xsd...
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
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?
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...
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
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,...

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.