Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Share a CS file with 2 different projects using Visual Studio 2010 and Subversion

We are moving from SourceSafe to Subversion as our source control provider... All is going well so far except I can figure out how you "share" a file between more than one project. In sourcesafe you made a link to the file and then added it to your project, then source safe knew that the file was really just one file. How do you do the equivalent with Subversion?

like image 323
Matthew Sanford Avatar asked Aug 22 '11 18:08

Matthew Sanford


People also ask

How do I share files between projects in Visual Studio?

Creating a Shared Project To create a new Shared Project, navigate to File > New > Project. In Visual Studio 2019, enter shared in the search box on the Create a new project page. Select the Shared Project template and then select Next.

Can two projects reference each other C#?

The easy way out: Create a shared library where you put in your shared code of P1 and P2. This shared project can be referenced by both P1 and P2. The better solution: Create an interface which you define in a shared library. Base your 'references' of P2 in P1 on the shared interface, not on the actual implementation.


1 Answers

You can add a file as a link within Visual Studio directly.

Doing this means you don't have to worry about how your source control will manage things, so long as the referenced file in in source control - the link is managed by VS.

like image 74
Oded Avatar answered Oct 20 '22 20:10

Oded