1

I have a situation where a class library project is used by multiple other projects in Visual Studio. While working on one project sometimes I may have to make changes in the shared code that is relevant to one of the other libraries. These changes may break something in the other class libraries until the necessary work is done to bring all other in line with the changes in the shared library.

The question is, how do I share the library and reference specific versions in the other projects?

King
  • 183
  • 10
manicouman
  • 11
  • 2

1 Answers1

0

If these libraries are source controlled, then whenever you want to compile a library that depends on your shared library, make sure you checkout the appropriate version of the shared library.

If these are .NET libraries, you could install the different versions of your shared library in your GAC, and have your dependent libraries reference the appropriate version of the .dll directly. Of course, you won't have the advantage of being able to change the shared library within the same solution as your application because it wouldn't be a referenced project.

Alternatively, instead of installing them in the GAC, you could keep a common directory with your versioned shared libraries (see the answer to this post: Visual Studio: Add same project or reference to different solutions).

Community
  • 1
  • 1
redcurry
  • 2,381
  • 2
  • 24
  • 38