Support net40
adamchester opened this issue · comments
This implementation was recently re-extracted from Serilog, and an unfortunate side effect was that we dropped support for net40
. Serilog is typically used in apps where newer runtime versions are easier to target, and dropping net40
made sense there. However, Message templates can be used in libraries where support for a wider range of framework versions are more important.
Examples of existing libraries that may target older net frameworks and could benefit from message templates are: web servers (eg. suave), actor frameworks (eg. Akka.net), libLog, build tools (eg. Fake).
The main issues for supporting net40
is use of System.Reflection
and collections (eg. IReadOnlyDictionary<T>
), which were solved previously by a few well-placed #if
directives.
A pain in serilog (1.5.x) was the lack of binary compatibility between net40 and net45. For example, the use of IReadOnlyDictionary<T>
(only available in net45+) in the public interface makes it impossible for net40
targets to execute against net45
binaries. Message templates C# inherited this problem from Serilog, but we are pre 1.0 and can avoid that mistake by changing the public API types to only use types available in all supported targets.
/cc @nblumhardt thoughts?
Fixed via #6