What is the alternative to having code with conditional compilation in C#?
I have a class that has lots of code that is based on # ifdef .. After sometime my code is unr
Polymorphism.
Approach it the same way as you would any spaghetti code with lots of conditional branches on the same condition.
Abstract out the differences into a base class or interface.
Construct the concrete class depending on build (one #if). Pass the concrete object to your App, and then your app calls the methods defined on the interface.