So I’m trying to build a C# project in Mono. I want to include a reference to System.Deployment conditional on the presence or absence of the __MonoCS__ constant that the Mono Compiler defines. I’m not sure if those constants are even defined yet when MSBuild gets a hold of my .csproj though.
I think I might have to Add a Mono configuration which would define a MONO constant and then i can remove the reference to System.Deployment and conditionally compile the lines i need with an #if MONO command…but it would be so much easier if I could simply add Condition="Defined(__MonoCS__)" to the line in question and call it good…
I think you are unfortunately getting things backwards. The compiler constants are never passed back to MSBuild, the chain of invocation is MSBuild -> Compiler -> Preprocessor.