Search code examples
.netvisual-studiocode-sharing

How do you share code between projects/solutions in Visual Studio?


I have two solutions which have some common code, so I'd like to extract it out and share it between them. Furthermore, I'd like to be able to release that library independently because it might be useful to others.

  • What's the best way to do it with Visual Studio 2008?
  • Is a project present in more than one solution?
  • Do I have a separate solution for the separate piece of code?
  • Can a solution depend on another one?

Solution

  • A project can be referenced by multiple solutions.

    Put your library or core code into one project, then reference that project in both solutions.