We have Preprocessor Directives in Visual Studio for c#, for example:
Unless you're distributing the raw C# project to be included in several solutions, you're out of luck. If you're going that route, you'd use them the same as any other
Most libraries are distributed as pre-compiled source which means that all of the
#defines would've been handled already. You'd have to fall back to configuration values (which is exactly how behaviors like this should be handled).