By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,695 Members | 1,651 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,695 IT Pros & Developers. It's quick & easy.

Sharing Source Code Across Different Solutions

P: n/a
I have common classes that I would like to share amongst a few stand
alone projects. They are independent of each other and not related in
any way. For the life of me, I cannot figure out how to share a
single source code file amongst multiple projects. When I attempt to
add an existing item to a project, Visual Studio makes a copy of the
file. I do not want ten copies of the same source code that I later
have to maintain.

I tried editing the file name and adding ..\Common\whatever.vb, but
this is not permitted. It seems like such a simple thing that I
should not be struggling with.

Any help would be appreciated.

Thanks.
Jul 15 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
ja***@onepost.net wrote in news:at********************************@4ax.com:
I have common classes that I would like to share amongst a few stand
alone projects. They are independent of each other and not related in
any way. For the life of me, I cannot figure out how to share a
single source code file amongst multiple projects.
Create a library (DLL).
Jul 15 '07 #2

P: n/a
<ja***@onepost.netschrieb:
[...] I cannot figure out how to share a
single source code file amongst multiple projects. When I attempt to
add an existing item to a project, Visual Studio makes a copy of the
file. I do not want ten copies of the same source code that I later
have to maintain.
Click "Add Existing Item...", select the file, and then change the
dropdown button to reference the file only and keep it in its original
location.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Jul 15 '07 #3

P: n/a
On Sun, 15 Jul 2007 19:39:31 +0200, "Herfried K. Wagner [MVP]"
<hi***************@gmx.atwrote:
>Click "Add Existing Item...", select the file, and then change the
dropdown button to reference the file only and keep it in its original
location.
Interesting -- I do not have these options after clicking Add Existing
Item.

Ah -- I just found it. There's a drop down arrow to the right of the
Add button. I have to select "Add As Link."

Thanks!
Jul 15 '07 #4

P: n/a
On Sun, 15 Jul 2007 17:37:27 GMT, Spam Catcher
<sp**********@rogers.comwrote:

>Create a library (DLL).
Yeah -- this would have been my last resort. I have the source shared
now though.
Jul 15 '07 #5

P: n/a
ja***@onepost.net wrote in news:vm********************************@4ax.com:
On Sun, 15 Jul 2007 17:37:27 GMT, Spam Catcher
<sp**********@rogers.comwrote:

>>Create a library (DLL).

Yeah -- this would have been my last resort. I have the source shared
now though.
It's probably the best way too :-)
Jul 15 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.