datalust/seq-client-log4net

Seq.Client.Serilog package should specify minimum version for Microsoft.Net.Http

kristofferlindvall opened this issue · 5 comments

I were unable to compile an application referencing the .NET 4.0 version of Seq.Client.Serilog (2.0.11) from NuGet.

I got the "The type or namespace name 'Seq' could not be found (are you missing a using directive or an assembly reference?" problem which often comes from loading assemblies built against newer .NET frameworks than the current. Visual Studio did not complain, only the compiler.

Getting the source and compiling manually through Visual Studio created a working DLL, so perhaps there's some difference between the NuGet release and a manual build.

Turns out it seems, that the real problem was caused by the Microsoft.Net.Http dependency. In the project that used Seq.Client.Serilog, There was also a reference to Microsoft.Net.Http version 2.0.20710.0.

When I updated to Microsoft.Net.Http.2.2.18 the project compiled, even with the Seq.Client.Serilog package from NuGet.

Interesting - thanks for the follow-up. As far as I can tell the .csproj has the right references, but I'll keep an eye on this and upgrade the project itself too when I have a chance.

To clarify, it was the project that references Seq.Client.Serilog that had previously installed an old version of Microsoft.Net.Http. This should be reproducable using the following steps:

  1. Create a new .NET 4.0 project
  2. Run Install-Package Microsoft.Net.Http -Version 2.0.20710
  3. Run Install-Package Seq.Client.Serilog
  4. Configure a Seq sink
  5. Compile

The solution to the problem is perhaps to add a minimum version requirement of Microsoft.Net.Http to the Seq.Client.Serilog NuGet package.

Yep, sounds like a plan - thanks!