0

I cannot find any option to add custom Macros (for Build Events). I am in a .Net environment and its about Visual Studio 2017.

I want to define a "var" which can be used both in the Build Events $(myVar) and in Code. Is this even possible?

1 Answers1

0

You can define a pre-build event that generates a C# file (using echo ... > file.cs) that declares a class with a constant.

You would define the variable as an MSBuild variable in a tag in the project file.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964