Sharing Source Code Across Different Solutions

  • Thread starter Thread starter jamil
  • Start date Start date
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.
 
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).
 
[...] 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.
 
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!
 
Back
Top