question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Looks like its similar to this issue: https://github.com/serilog/serilog-sinks-seq/issues/70

We aren’t using Azure like the OP there, but we are are upgrading an old AspNet MVC 6 / Web Api 2 project. Version 1.5 of Seq works but we need to upgrade to 2.0+ (2.5 with 3.4.0 of Serilog.Sinks.Seq).

Method not found: 'Serilog.LoggerConfiguration Serilog.SeqLoggerConfigurationExtensions.Seq(Serilog.Configuration.LoggerSinkConfiguration, System.String, Serilog.Events.LogEventLevel, Int32, System.Nullable`1<System.TimeSpan>, System.String, System.String, System.Nullable`1<Int64>, System.Nullable`1<Int64>, Serilog.Core.LoggingLevelSwitch, System.Net.Http.HttpMessageHandler, System.Nullable`1<Int64>, Boolean, Int32)'.
[MissingMethodException: Method not found: 'Serilog.LoggerConfiguration Serilog.SeqLoggerConfigurationExtensions.Seq(Serilog.Configuration.LoggerSinkConfiguration, System.String, Serilog.Events.LogEventLevel, Int32, System.Nullable`1<System.TimeSpan>, System.String, System.String, System.Nullable`1<Int64>, System.Nullable`1<Int64>, Serilog.Core.LoggingLevelSwitch, System.Net.Http.HttpMessageHandler, System.Nullable`1<Int64>, Boolean, Int32)'.]
   ProjectName.WebApiApplication.Application_Start() in C:\Project\Project.Web\Global.asax.cs:34

[HttpException (0x80004005): Method not found: 'Serilog.LoggerConfiguration Serilog.SeqLoggerConfigurationExtensions.Seq(Serilog.Configuration.LoggerSinkConfiguration, System.String, Serilog.Events.LogEventLevel, Int32, System.Nullable`1<System.TimeSpan>, System.String, System.String, System.Nullable`1<Int64>, System.Nullable`1<Int64>, Serilog.Core.LoggingLevelSwitch, System.Net.Http.HttpMessageHandler, System.Nullable`1<Int64>, Boolean, Int32)'.]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +10061317
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +173
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): Method not found: 'Serilog.LoggerConfiguration Serilog.SeqLoggerConfigurationExtensions.Seq(Serilog.Configuration.LoggerSinkConfiguration, System.String, Serilog.Events.LogEventLevel, Int32, System.Nullable`1<System.TimeSpan>, System.String, System.String, System.Nullable`1<Int64>, System.Nullable`1<Int64>, Serilog.Core.LoggingLevelSwitch, System.Net.Http.HttpMessageHandler, System.Nullable`1<Int64>, Boolean, Int32)'.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10042604
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +95
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2556.0

Fails in our Global.asax if we leave our Write.To.Seq(blah) in place. Removing it allows the application to launch properly, but obviously can’t log to seq anymore 😦

So far the only way to get it to work is to downgrade to v 1.5 of Seq, which doesn’t work with some other logging we are trying to add.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
rolfikcommented, Jan 15, 2018

Well, this is ugly error. We had it as well, but in a little different scenario: One shared library initializing Serilog logging to Seq called in two applications. One application was working well, another was failing. The difference was a .csproj setting regarding assembly redirects - the correct one which puts correct redirects into .config is AutoGenerateBindingRedirects = true: image

2reactions
nblumhardtcommented, Nov 2, 2017

Terrific 👍

Assembly version matching is precise/strict on the .NET CLR, so unless all binaries are built against the exact same version of a dependency, redirects are necessary.

In this case, since Serilog.Sinks.Seq was built against a different System.Net.Http version to your app, the HttpMessageHandler argument to WriteTo.Seq() isn’t considered to be the exact same type as the HttpMessageHandler type already loaded into the appdomain.

One of the big improvements in .NET Core is a looser policy around these things, I think.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Method not found on runtime
"Method not found" is a very specific error, which means a method it expected (i.e. was there at compile time) simply is not...
Read more >
System.MissingMethodException - Method not found in C#
To fix the Method not found error in C#, ensure that the latest assemblies are deployed and no duplicate or older assemblies are...
Read more >
MissingMethodException Class (System)
MissingMethodException is thrown when code in a dependent assembly attempts to access a missing method in an assembly that was modified. MissingMethodException ...
Read more >
Why am I getting method not found exception?
Here is the error message: Method not found: 'Void ssContactManagementServices.Actions.ActionUpdateMessageById(OutSystems.HubEdition.
Read more >
Question - MissingMethodException: Method not found.
I've written a basic script that allows the player to slow time while they are aiming a weapon. Everything works fine until I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found