There is a file C:\Users\Me\source\repos\MyProject\VersionInfo.cs
that is somehow contained within all but one projects in the MyProject
solution; editing one copy of it simultaneously edits all of them, but it only shows up once in source control, at the solution level. How is this possible? How can I add it to the last project? I tried "add existing file" but that just copied it into that folder... if it helps any there is a little blue "arrow in a box" icon on it...
Asked
Active
Viewed 791 times
4

ekolis
- 6,270
- 12
- 50
- 101
-
4You need "Add as Link" to prevent the copy. Click the arrow on the Add button to get it. – Hans Passant May 03 '20 at 16:03
1 Answers
7
You have a file which was added as a link. You can read about it for example here or here. You can achieve this via Add -> Existing Item dialog but instead of clicking "Add" click on the dropdown arrow to the right and select "Add As Link":
Or by manually editing .csproj:
<ItemGroup>
<Compile Include="..\OtherFolder\VersionInfo.cs" Link="VersionInfo.cs" />
</ItemGroup>

Guru Stron
- 102,774
- 10
- 95
- 132