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.

MissingMethodException - Serilog.LoggerConfiguration Serilog.SeqLoggerConfigurationExtensions.Seq()

See original GitHub issue

I’m getting this exception when starting up my Azure Function App locally from Visual Studio:

System.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)'.

My LoggerConfiguration is:

var environmentName = CloudConfigurationManager.GetSetting("Environment") ?? "Local";
var seqPath = CloudConfigurationManager.GetSetting("SeqPath") ?? "http://localhost:5341/";
var seqApiKey = CloudConfigurationManager.GetSetting("SeqApiKey") ?? "";
var levelSwitch = new LoggingLevelSwitch();

var loggerConfiguration = new LoggerConfiguration()
    .WriteTo.Seq(seqPath, apiKey: seqApiKey, controlLevelSwitch: levelSwitch)
    .WriteTo.TraceWriter(traceWriter)
    .MinimumLevel.ControlledBy(levelSwitch)
    .Enrich.WithProperty("Environment", environmentName);

If I remove this line, the problem goes away:

.WriteTo.Seq(seqPath, apiKey: seqApiKey, controlLevelSwitch: levelSwitch)

I’m using…

  • Visual Studio 15.3.0 Preview 2.0 (required for the Azure Functions tooling)
  • .NET Framework 4.6.2
  • Any CPU
  • Conditional compilation symbols: NET462
  • The following packages:
    <PackageReference Include="Microsoft.Azure.WebJobs" Version="2.1.0-beta1" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions" Version="2.1.0-beta1" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="1.0.0-beta1" />
    <PackageReference Include="Microsoft.Azure.WebJobs.ServiceBus" Version="2.1.0-beta1" />
    <PackageReference Include="Microsoft.WindowsAzure.ConfigurationManager" Version="3.2.3" />
    <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.0-alpha3" />
    <PackageReference Include="Serilog" Version="2.4.0" />
    <PackageReference Include="Serilog.Sinks.AzureWebJobsTraceWriter" Version="1.0.20" />
    <PackageReference Include="Serilog.Sinks.Seq" Version="3.3.1" />

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
tjrobinsoncommented, Jun 21, 2017

Right, I’ve made some progress. This reproduces the issue:

https://github.com/tjrobinson/SerilogSeqIssue70

Removing the reference to System.Net.Http 4.3.2 fixes it!

Unfortunately that’s not possible in my real usage but it’s a clue.

0reactions
vishal-boldcommented, Jun 12, 2019

Hi Tom,

I didn’t install Azure Functions runtime on this machine, but got the System.Net.Http related error to repro by referencing output binaries from a separate console app.

In my case, I was able to get rid of the error by running:

install-package system.net.http -Version 4.3.2

in the consuming app. I’m not sure whether doing this from the Azure Function project itself will help, but it might be worth a try.

(This SO answer makes me think we could be hitting a limitation of the platform: https://stackoverflow.com/a/38101488/138206.)

This solution solved my problem. I had different vesion of system.net.http.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Method not found: 'Serilog.LoggerConfiguration
Turns out I was referencing an older nuget package in my Main Assembly than I was in the sub assembly. After updating them...
Read more >
System.MissingMethodException: Method not found: ...
Hi, I'm getting a MissingMethodException when I try to use the File Sink. Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() .
Read more >
The Intuit QBO connector for .NET is not compatible ... - Help
Using the connector generates the following error: System.MissingMethodException: 'Method not found: 'Serilog.LoggerConfiguration Serilog.
Read more >
Seq sink not working using config file ...
Hello, I'm using Serilog on FW 4.7.1 but unable to get logging ingress to Seq ... mLogger = new LoggerConfiguration() .MinimumLevel.Debug()
Read more >
[Solved]-Method not found: 'Serilog.LoggerConfiguration ...
Coding example for the question Method not found: 'Serilog.LoggerConfiguration Serilog.LoggerConfigurationLogentriesExtensions.Logentries-.net-core.
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