You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Confusing warning when Extensions are used with .NET Framework TFM #5162
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.
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".
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.
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.
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.
This topic has continued coming up occasionally. The team discussed it and decided the diagnostic messages and the friction they cause is overkill. We will maintain the position that .NET Framework specific compatibility issues would likely be closed as not planned, but we are going to remove the diagnostics.
Activity
reyang commentedon May 16, 2024
Thanks @xakep139!
In OpenTelemetry .NET, we recommend users to use
Microsoft.Extensions.Telemetry.Abstractionsfor strongly typed complex object logging. Currently we have to setSuppressTfmSupportBuildWarnings=trueand 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 ofMicrosoft.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
noahfalk commentedon May 17, 2024
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.
xakep139 commentedon May 17, 2024
cc @joperezr
ps-weber commentedon Aug 28, 2024
Can you confirm that specific extensions are indeed compatible with .NET framework? I am using
Microsoft.Extensions.TimeProvider.Testingand it is specifically tagged as compatible with .NET Framework on nuget.org.joperezr commentedon Aug 28, 2024
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.
ps-weber commentedon Sep 3, 2024
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.
jeffhandley commentedon Nov 5, 2026
This topic has continued coming up occasionally. The team discussed it and decided the diagnostic messages and the friction they cause is overkill. We will maintain the position that .NET Framework specific compatibility issues would likely be closed as not planned, but we are going to remove the diagnostics.
KalleOlaviNiemitalo commentedon Nov 5, 2026
Please make sure the policy is documented in each package README.