I'm getting a MissingMethodException when I try to use the File Sink.
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.File(logFilePath, rollingInterval: RollingInterval.Day, shared: true)
.CreateLogger();
This is really weird as I've used it before with the same settings and it never gave any issue, but I'm sure this is what's giving the error because if I get rid of the .WriteTo.File() line I don't get the error.
Here's my packages.config:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ModPlus.Revit.API.2020" version="1.0.0" targetFramework="net472" />
<package id="Serilog" version="2.9.0" targetFramework="net472" />
<package id="Serilog.Sinks.File" version="4.1.0" targetFramework="net472" />
</packages>
Can you think of a reason why this is happening?
I've seen similar issue and it is usually due to version mismatch in assembly files but I checked and I'm referencing the right versions (at least as far as I can see in my packages.config)
EDIT:
Here's the full unhandled exception
EDIT 2: The code that calls Serilog is a plugin for Revit (3D modelling software) and I just tried to run this plugin in 2 different versions of the platform:
- Revit 2020, I get that unhandled exeption
- Revit 2019, it works fine! (I need the plugin to work on both versions)
Both the versions of the software use the same version of .NET Framework, 4.7.2
Does this give more clues?
What could be going wrong in one version and not on the other?