I'm writing a library, and I want a class to implement and make use of IReadOnlyList<T>
if possible. However, that interface is only available starting at framework version 4.5, and I don't want to be tied to that version just because of this one interface.
Is there a way I can automatically compile two versions of the library, one for 4.5 (that will implement the interface, and possibly have some other features as well), and another for 3.5?
As an example, I'm looking for something like an MSBuild configuration that says "compile this library in two [or more] versions" and then specify different options for each one, like defined symbols, framework, references, etc.
If this is possible, it could actually solve a number of other similar problems I've been having.