Suggestion: it would be great if C# could conditionally include/exclude code based on the availability of a type:
// Optional code that requires System.Web
Currently there is no mechanism for conditional compilation in C# based on the target platform. Rather than requiring a specific platform however, sometimes its a feature available in some platforms that's required.
For example, suppose a particular build of a library has extra features if the DLR is available. Rather than checking .NET40, why not conditionally include it like this:
This would also be useful for code distributed as source rather than an assembly (as is sometimes the case with NuGet now - see Massive, PetaPoco and Dapper for example) where one wants to conditionally include code depending on the target project's referenced assemblies.
For example, as the developer of PetaPoco (a micro ORM) I would like to be able to optionally include better support for SQL Server geography types - but only if the target project has an assembly reference to those types.