Description
If you add Serilog 3.1.0+ plus to a .NET Core 2.1 application and attempt to build, you will get an error. For example, from our CI:
/project/packages/system.runtime.compilerservices.unsafe/6.0.0/buildTransitive/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.targets(4,5): error : System.Runtime.CompilerServices.Unsafe doesn't support netcoreapp2.1. Consider updating your TargetFramework to netcoreapp3.1 or later.
Reproduction
Use 3.1.0+ in a .NET ore 2.1 application
Expected behavior
The application should build without warnings
Relevant package, tooling and runtime versions
Serilog 3.1.0
.NET Core 2.1
Additional context
I wanted to clarify (warn?), that as Serilog 3.1.0 added a reference to System.Diagnostics.DiagnosticSource, which references System.Runtime.CompilerServices.Unsafe, you have effectively dropped support for .NET Core 2.x, due to the way Microsoft started adding .targets
files that explicitly error when the netstandard2.0 parts are used on < .NET Core 3.1 TFMs:
If this was added in 3.0.0 it wouldn't have been an issue, but I would argue that (inadvertently) dropping TFMs in a minor version bump is very non-semver 🙈
If you're not aware of the issue, I wrote about it last year: https://andrewlock.net/stop-lying-about-netstandard-2-support/. The onus is firmly on MS on this one IMO, but library authors don't seem to realise the implications of adding dependencies on some of these libraries (i.e. System.Diagnostics.DiagnosticSource).
For what it's worth StackExchange.Redis similarly added a dependency recently and accidentally dropped support, as described here.
Just to be clear, I'm not at-all saying you should support .NET Core 2.1 just that it looks like you do to NuGet, because of the netstandard2.0
TFM. But most of the runtimes that would use this TFM (.NET Core 2.x and 3.0) won't work. Basically only Xamarin can use it without error AFAIK.
And it's misleading in NuGet because it looks like you should be able to use it without issues on .NET Core 2.x. So just consider this a heads up 😄
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4