MissingMethodException - Serilog.LoggerConfiguration Serilog.SeqLoggerConfigurationExtensions.Seq()
See original GitHub issueI’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:
- Created 6 years ago
- Comments:18 (8 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
This solution solved my problem. I had different vesion of system.net.http.