I am writing an assembly with some conditionally compiled elements, for example:
[Conditional("DEBUG")]
public static void Log(string message) { }
And using it like this:
public void DoStuff() {
Log("This will only appear on debug builds");
}
But when I give this assembly to someone to use in my project, I want them to be able to determine if the conditional members of DEBUG are compiled or not.
If this is not possible (for example, methods are completely removed at compile time), is there a way to pack several assembly “configurations” (for example, possibly with [AssemblyConfiguration] ) and select them according to the configuration of the reference assembly?
Also: I'm not looking for suggestions to manually set the links in the .csproj file of the referencing assembly; I know I can do this, but it is tedious and needs to be done for every link.