Serilog fails to compile

Hi there,

i tried to convert Serilog (GitHub - serilog/serilog: Simple .NET logging with fully-structured events) to compile with Elements and i(t) failed with 282 errors.

For some reason, there seems to be a problem with conditional compilation.

One of many examples in ILogger.cs: (“FEATURE_DEFAULT_INTERFACE” is defined in the project settings)

    void Verbose(Exception exception, string messageTemplate, params object[] propertyValues) // E1 opening brace expected, got 
#if FEATURE_DEFAULT_INTERFACE                                                                 // E375 One of "this", identifier, "operator" expected, got lambda
        => Write(LogEventLevel.Verbose, exception, messageTemplate, propertyValues)           // E130 Type expected

There seem to be other errors too, but they may be consequential errors.

Would be nice, if you could take a look at it.

“Converted” project from Github, reduced to the core project only (tests, assets, nuget etc. removed). (149.0 KB)

Best regards


Thanks, logged as bugs://85982

this seems to be an issue with Elements more strict (but smarter) rules on how #if directives interact with the rest of the code. Though I agree this one should be ok, so I’ve logged an issue.