Description
The .NET 6 version of Microsoft.NET.Sdk.Web
introduces a default global using statement for Microsoft.Extensions.Logging
. This brings MEL's ILogger
into scope everywhere, breaking existing code that uses Serilog's (or another framework's) ILogger
interface, with errors like:
/home/pi/dl/nix/seq/tmp/ubuntu.20.04-arm64/src/Seq/Server/Tasks/TaskRunner.cs(15,18): error CS0104: 'ILogger' is an ambiguous reference between 'Microsoft.Extensions.Logging.ILogger' and 'Serilog.ILogger' [/home/pi/dl/nix/seq/tmp/ubuntu.20.04-arm64/src/Seq/Seq.csproj]
The breakage can be worked around by adding <EnableDefaultGlobalUsing>false</EnableDefaultGlobalUsing>
or similar to the project's CSPROJ file, but this is a pretty nasty papercut that penalizes users for choosing a logging library other than Microsoft's. The chore will be particularly onerous because of the number of projects affected (and volume of errors within these projects).
I'd also expect that many users will turn to the Serilog project asking for guidance or reporting the breakage as a bug, since the default assumption people make when encountering an issue like this is that "Serilog is broken on .NET 6" - which increases our support burden :-)