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

You can “link” a code file between two projects. Right click your project, choose Add -> Existing item, and then click the down arrow next to the Add button:

Screengrab

In my experience linking is simpler than creating a library. Linked code results in a single executable with a single version.

Leave a Comment