Confusing warning when Extensions are used with .NET Framework TFM
When one of Extensions package is referenced in a .NET FX application, there will be a warning emitted:
warning : Microsoft.Extensions.Compliance.Abstractions 8.2.0 doesn't support net462 and has not been tested with it. Consider upgrading your TargetFramework to net6.0 or later. You may also set <SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings> in the project file to ignore this warning and attempt to run in this unsupported configuration at your own risk.
This is really confusing for users and we need to consider rephrasing or maybe removing it.
cc @joperezr @danmoseley @reyang
Thanks @xakep139!
In OpenTelemetry .NET, we recommend users to use Microsoft.Extensions.Telemetry.Abstractions for strongly typed complex object logging. Currently we have to set SuppressTfmSupportBuildWarnings=true and I've heard from users that they don't really know if it is expected to work in .NET framework, or it might stop working with any future version of Microsoft.Extensions.Telemetry.Abstractions, or it might occasionally fail due to some implementation details - in a nutshell, users don't understand the warning message and they tend to interpret it as "you cannot bet on it if you are on .NET Framework".
https://github.com/open-telemetry/opentelemetry-dotnet/blob/1bbafaa7b7bed6470ff52fc76b6e881cd19692a5/docs/logs/complex-objects/complex-objects.csproj#L3
This is really confusing for users and we need to consider rephrasing or maybe removing it.
If a 3rd party uses an extensions library, encounters an issue and reports it to Microsoft are the maintainers going to address it? If yes then it seems like the warning should be removed.
cc @joperezr
Can you confirm that specific extensions are indeed compatible with .NET framework? I am using Microsoft.Extensions.TimeProvider.Testing and it is specifically tagged as compatible with .NET Framework on nuget.org.
Trying to clarify a bit: the warning doesn't mean that the given package is not compatible with .NET Framework, but instead it is only signaling that the package is not supported in .NET Framework. What this all means is that while the package may work when used in a .NET Framework application, we may not be able to fix/service issues that only affect .NET Framework but not latest .NET. The warning is meant to ensure that you as a consumer of the package understand this, and disabling the warning is the way to acknowledge it.
That is why NuGet.org would still list all of these packages as "compatible" with .NET Framework, since most of them (including Microsoft.Extensions.TimeProvider.Testing) are, but that doesn't mean they are supported.
Hope this helps clarify a bit.
Thanks, that does clarify it.
As someone who works with a large .NET Framework project, Microsofts approach here is a bit frustrating. TimeProvider got back ported to .NET framework, but there is no supported "standard" Fake for it. I can either use an unsupported one or write my own fake, neither approach seems right.