-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MissingMethodException - Serilog.LoggerConfiguration Serilog.SeqLoggerConfigurationExtensions.Seq() #70
Comments
Thanks for getting in touch. This is a strange one - the There are two possible causes I can think of:
Any other clues? :-) |
I've checked that I'm assuming it's something specific to the Azure Functions runtime. It could be a variation of this similar sounding issue: I'll see if I can put together a repro. |
Right, I've made some progress. This reproduces the issue: https://github.com/tjrobinson/SerilogSeqIssue70 Removing the reference to Unfortunately that's not possible in my real usage but it's a clue. |
Failing output from the Azure Functions CLI:
Detailed build output:
|
Thanks for the follow-up and repro. I'm guessing it's a build targeting issue - perhaps the build tools for Azure functions are packaging binaries for a different TFM to what the compiler is using? I'll get the runtime installed locally and see if I can cook up a workaround 👍 |
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:
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.) |
I'm also having this Issue, but the Version of system.net.http is already 4.3.2 |
@MrBliz thanks for the note. Can you share your packages/project config? I'm not sure where to start digging into this, but we might spot some clues that way. |
The Serilog.Sinks.Seq 3.4.0 release seems to have fixed this issue for us, thanks! 🤞 |
Hmm, I spoke to soon. I'm still getting this Exception:
|
Thanks for the update @tjrobinson. I did hit this exception when testing the new package, IIRC, but got around it by making sure the host project had explicit references to the same packages Serilog.Sinks.Seq did. For 3.4.0 it looks like: https://github.com/serilog/serilog-sinks-seq/blob/dev/sample/Sample/Sample.csproj#L23 (Where the Any luck? |
@nblumhardt Some luck. Using your suggestion above I can fix the issue for my minimal reproduction project, see: tjrobinson/SerilogSeqIssue70@master...fix Unfortunately for my "real" code the issue still remains. I have to take a few dependencies on other libraries including things like I might just wait for the 2.0 release of Azure Functions, which is fully .NET Core. Edit: Released today! |
Thanks for the follow-up @tjrobinson ; I think you might need the other half of the fix, too - i.e., reference the framework assembly if it's a .NET 4.x target: https://github.com/serilog/serilog-sinks-seq/blob/dev/sample/Sample/Sample.csproj#L27 Any luck? |
I'm only targeting |
At least as far as my limited investigation suggested, the only way to get around this reliably is to have full FX projects reference the assembly rather than the package. May not turn out to be universally the case, but worth a shot :-) |
Great! :-) 👍 |
This solution solved my problem. I had different vesion of system.net.http. |
I'm getting this exception when starting up my Azure Function App locally from Visual Studio:
My
LoggerConfiguration
is:If I remove this line, the problem goes away:
I'm using...
The text was updated successfully, but these errors were encountered: