Sharing Source Code Across Different Solutions

J

jamil

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.
 
G

Guest

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).
 
H

Herfried K. Wagner [MVP]

[...] 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.
 
J

jamil

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top