datalust/serilog-sinks-seq

Found conflicts between different versions of "System.Net.Http" that could not be resolved - in Xamarin Android

jmalczak opened this issue · 4 comments

Hi Guys

I am having issues with seq sing in Xamarin Android project. After adding serilog sink nuget package I get following warning in logs:

Found conflicts between different versions of "System.Net.Http" that could not be resolved.

There is no way to solve it by using binding redirects as far as I can tell.

image

Project:

Visual Studio 2017 15.9.7
Xamarin 4.12.3.80
Serilog.Sinks.Seq 4.0.0
Targetting Android 8.1 Oreo

Repro:

Create new project using default Xamarin Android template, select empty project.
Build -> no warnings, add seq sink -> build -> warning

I have tried:

  1. Adding app.config and remapping system.net.http to 4.0.0.0 in binding redirect
  2. Adding separate system.net.http nuget package and forcing binding redirect to the newest version

Thanks!

Hi @jmalczak - it seems like this might be a spurious warning, there has historically been some confusion about how/where this occurs and whether it is correct: https://bugzilla.xamarin.com/show_bug.cgi?id=22670

Does the app still run, and log events to Seq? Thanks!

Hi @nblumhardt - the problem is that we want to treat warnings as errors and this one issue prevent us from doing that. I have seen bug that you have provided. It looks like was closed in 2017 and I am using latest version of both Visual Studio and Xamarin. App still run and send events to Seq.

Thanks

👍 makes sense. You should be able to achieve this using <NoWarn> in the CSPROJ, but I can't spot the warning code in the screenshot. Worth a try.

I have no idea how we can tackle this at the package level, but if there's some way for us to avoid it without breaking other targets I can help with the change. Zero Xamarin knowledge here, though, except for the memory of some bad experiences using early versions of the tooling :-)

I'll close this one as stale, as I still don't know of any course we could take to fix this from our side, but let me know if you still need some help with this, @jmalczak. Cheers!