I am trying to set a C# variable (string) to be compiled during the call to msbuild using the "/p" argument:
msbuild.exe mysolution.sln -p:MyCustomProperty=MyCustomValue
However, I'm stuck on how to access this "MyCustomProperty" value (MyCustomValue) in C# code... I was hoping for something simple like using an Attribute like this:
[GetAProjectPropertyAttribute("MyCustomProperty")]
public string MyVariable = "";
But I don't know if such an attribute exists? Are C# project properties not accessible during the compile to set certain code statements?
Any help is appreciated!