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
NUnit is not trimmer-safe, and produces a lot of trimmer warnings.
Ideally we'll fix NUnit or come up with an alternative (see #19911), but
that's a significant amount of work.
We also want to turn warnings into errors (to avoid adding more trimmer
warnings by accident).
So we disable trimmer warnings from NUnit. The method is somewhat complex,
because there's no built-in way to ignore warnings for a given assembly, but
both ILC and ILLink provides a way to collapse multiple warnings into a single
warning (with a specific code) on a per assembly basis, and we can levarage
this:
* We enable all warnings for all assemblies (by setting `TrimmerSingleWarn=false`).
* We enable the single-warning mode for NUnit only.
* We ask the trimmer to not warn about the specific warning code given for the
single-warning produced.
The end result is that we won't get any trimmer warnings for NUnit.
Ref: #19911
<!-- The above ItemGroup doesn't work for NativeAOT, so pass the argument manually to ILC: https://github.com/dotnet/runtime/issues/94255 -->
0 commit comments