I'm writing an assembly with some conditionally compiled members in it, e.g.:
[Conditional("DEBUG")]
public static void Log(string message) { /*...*/ }
And using it like so:
public void DoStuff() {
Log("This will only appear on debug builds");
/* ... Do stuff ... */
}
But when I give this assembly to someone to use in their project, I want them to be able to define whether or not DEBUG-conditional members are compiled.
If that's not possible (e.g. the methods are just completely removed at compile-time), then is there any way to package multiple 'configurations' of an assembly (e.g. maybe with [AssemblyConfiguration]) and select them according to the configuration of the referencing assembly?
Also: I'm not looking for suggestions to manually set the references in the .csproj file of the referencing assembly; I know I can do that, but it's tedious, and has to be done for every reference.
dll
's: debug and release one and use conditional referencing, or you can make thatLog
method to check something and either do job or ignore call. – Aphanite