1

I want to have a file with some enum's and use them in several projects in the same solution.

How could I use the same enums throught projects in the same solution instead of having to copy them into every .cs file?

Im from xcode and obj-c and not very used to Visual Studio c# :(

Arbitur
  • 36,899
  • 22
  • 86
  • 123
  • When you are adding the file add it as a link, so you don't have to maintain multiple copies. Watch carefully, there is a down arrow in the button in the add dialog box use that. – bansi Jul 13 '14 at 14:09

1 Answers1

1

If you have multiple projects that need to share source code you would create a new project as a class library type. Add the code to that project and then add it as a reference to the other projects that need it. Visual Studio will then handle building and sharing of the code for you.

To use the code in those projects you will have to define the using of the shared project in the C# files that need it.

If you need more detailed instructions. Just let me know.

Reactgular
  • 43,331
  • 14
  • 114
  • 176