0

I have some common code between two project solutions, and I would like to link a source file from one solution to another. Specifically, I would like to add/link a single .cs file from a different solution to my current one.

This seems to be a good answer. However, Visual Studio Code does not have the add as link or add existing item. It only have Add Folder to Workplace. Furthermore,dotnet add and dotnet sln add only takes .csproj file, which is the whole project.

So how do I achieve this?

cli2
  • 239
  • 1
  • 5
  • 12

1 Answers1

2

We generally don't share sources files because it creates all sorts of problems.

What we do is put the code in a class library and share the project (or assembly) with anything that needs it

TheGeneral
  • 79,002
  • 9
  • 103
  • 141