-
Notifications
You must be signed in to change notification settings - Fork 50
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
ASP.NET Core 1.1 + Serilog.Seq compatibility issue when targeting NET462 #56
Comments
Hi Natan, thank you for the issue report. I'm only just piecing together this scenarion, but I think there are two ways around this (unavoidable on our side AFAIK). They are:
Would it be possible to try out either method, and let us know what you have success with? Thanks! |
Hi @nvivo - I think this and #57 are related; I've just pushed what I hope is a fixed version as: https://www.nuget.org/packages/Serilog.Sinks.Seq/3.3.0-dev-00110 Can you please let me know if this does the trick for you? Many thanks! |
Hi @nblumhardt, I had tried the previous workarounds but it didn't work. The assembly bindings were being generated, but not for The 3.3 version solves the issue. Looks like the problem is referencing Just an idea, but maybe you don't need a new build for NET46, just reference |
Awesome, thanks for the feedback, Natan. I think we'll give this package a few days in "dev" and then push it to master, since it's an annoying issue to track down for users. @serilog/reviewers-core this is likely to affect all sinks that use System.Net.Http (it's not our issue, but we have a workaround). On .NET 4.5, since the issue isn't triggered I might leave the dependency structure as-is for now, since we've been through more than a few iterations and breakages to get where we are today. (If it ain't broke, ... :-) ) |
@nblumhardt Potentially you should have that as a dependency for the .net full framework 4.6.1 version of your package? |
Thanks for the bump, @waynebrantley! This should have already been the case, but the 3.3.0 version of this sink was yet to be published with the fix. Build is kicked off now, package should be on NuGet shortly. |
I am using 3.3.1 and on both 4.6.1 and 4.6.2 it crashes after not being able to find System.Net.Http 4.1.1 |
Thanks for the note, @alexeyzimarev. I just created a fresh .NET 4.6.1 project and installed Serilog 2.4 + Serilog.Sinks.Seq 3.3.1, (unfortunately?) it seems to work perfectly: The best I can come up with is perhaps you've changed the project's target framework version without uninstalling/reinstalling the package? I'm running VS2017, latest patches. Are you using the same IDE version? (If you are able to zip up a minimal project that reproduces the issue, feel free to email it through to nblumhardt@ either nblumhardt.com or getseq.net.) |
I have some apps running with the new csproj format, but targeting the full framework, and when referencing Serilog.Seq there seems to be some compatibility issue around System.Diagnostics.DiagnosticSource.
Here is a sample app to reproduce:
App.csproj
Program.cs:
Run with:
This gives me:
It seems Serilog.Seq requires System.Net.Http 4.0 which depends on System.Diagnostics.DiagnosticSource version 4.0, while ASP.NET Core 1.1 depends on 4.3. The build selects version 4.3 while the runtime tries to load 4.0. I suppose .NET should be generating assembly binding redirects for this, but it's not.
This issue doesn't happen if "netcoreapp1.1" is the target.
Now, if I add System.Diagnostics.DiagnosticSource 4.3 as a dependency to the project, the issue persists. If downgrade to 4.0, then I get lots of downgrade warnings for .NET components.
The text was updated successfully, but these errors were encountered: