0

I have a class file xxx.cs which I wish to share with 3 projects, each containing an executable. I know I can create a class library which can be shared by all three executables but I do not wish to create an extra library, I just want 3 standalone executables. Libraries in C# have weird copying problems on large projects.

C# share code between classes says don't copy code between projects. I'm not doing it but VS is.

If I add an existing file from another project to a project, VS takes a copy of that file into the local directory of the project so I now end up with 3 copies of the same file. When I then make the changes to one of the copies, it is not reflected in the other two. Again, VS doesn't do this in C++, only in C#. I'm just wondering if there is a way of stopping VS from taking a copy locally.

The workaround is to modify the vsproj file using notepad and change the file reference to a relative link. It then appears with a link symbol in VS. Instead of editing vsproj files, is there a way of doing this from VS?

Community
  • 1
  • 1
cup
  • 7,589
  • 4
  • 19
  • 42

0 Answers0