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?
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?
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.