PublishSingleFile, PublishTrimmed and SelfContained .. breaks serilog (Reflection issue?)
My requirements: Have a single executable, as small as possible. Therefor I use the options in the title to bundle everything into one file and turn it from 70+M to 12M (yes, it matters for this).
I need to log information during the runtime of the program and serilog would be my choice. It works fine/as expected in the debugger/while not bundled. I kinda make it work with the single executable now, but it fails to load one sink I need (serilog.sinks.eventlog). When I turn on serilogs own logging, I get the message
2024-01-10T22:55:17.8478998Z Unable to find a method called EventLog for supplied arguments: logName, manageEventSource, source. Candidate methods are:EventLog(, , , , , , , )EventLog(, , , , , , )
2024-01-10T22:55:17.8478998Z Unable to find a method called EventLog for supplied arguments: logName, manageEventSource, source. Candidate methods are:EventLog(, , , , , , , )EventLog(, , , , , , )
I don't believe this is serilog specific and likely more a general problem with bundling and/or trimming, but I have absolutely no idea how I could get to the bottom of this.