This file records the remaining warning-suppression and analyzer-cleanup backlog in this fork. It is a snapshot, not a policy document. Counts can change as .NET SDK analyzers, target frameworks, and project references change.
Date: 2026-07-29
Commands used from the Trace Arena repo root:
rg -n --hidden \
--glob '!**/bin/**' \
--glob '!**/obj/**' \
--glob '!**/Artifacts/**' \
--glob '!artifacts/**' \
--glob '!**/.git/**' \
--glob '!third_party/MonoGame/native/monogame/external/**' \
'NoWarn|WarningsNotAsErrors|RunAnalyzers|EnableNETAnalyzers|DisableSpecificWarnings|UnconditionalSuppressMessage|#pragma[[:space:]]+warning[[:space:]]+disable' \
third_party/MonoGame
dotnet build third_party/MonoGame/MonoGame.Framework.Content.Pipeline/MonoGame.Framework.Content.Pipeline.csproj \
-p:DisableNativeBuild=True \
-p:NoWarn= \
-p:EnableNETAnalyzers=true \
-p:AnalysisLevel=latest \
-v:minimalThe focused analyzer build clears project NoWarn, enables SDK analyzers, and disables the native
pipeline build. It measures the content pipeline project plus its referenced DesktopGL framework
project; it is not a full-fork, every-platform measurement. MSBuild prints each diagnostic once
during compilation and again in its final warning summary, so warning-line counts are twice the
reported MSBuild warning total.
| Area | Current measured size | Notes |
|---|---|---|
| Explicit suppression lines | 2 | One documented trim boundary and one serializer-test namespace pragma. |
| Focused analyzer warning lines | 0 | Content pipeline project with NoWarn cleared and analyzers enabled, plus referenced DesktopGL framework project. |
| Content pipeline share | 0 | Warning lines attributed to MonoGame.Framework.Content.Pipeline.csproj. |
| DesktopGL framework share | 0 | Warning lines attributed to MonoGame.Framework.DesktopGL.csproj through the project reference. |
| Unique diagnostic IDs in focused build | 0 | The focused production slice is clean. |
Use this checklist as the live tracker for warning cleanup work. Check an item only when the suppression or warning family is removed, the corresponding validation has passed, and any package or platform behavior affected by the change has been inspected.
- Capture the current explicit suppression inventory.
- Capture a focused no-suppression analyzer build for the content pipeline slice.
- Add a repeatable script or Make target for regenerating this inventory.
- Add a machine-readable warning-count artifact for before/after comparison.
- Fix or document
NU5128insrc/NuGetPackages/Directory.Build.props. - Fix or document
NU5100inMonoGame.Framework.Content.Pipeline.csproj. - Migrate off prerelease
System.CommandLineto stable 2.0.10 and update the parser to its supported API (NU5104). - Decide whether
CS1591belongs at project scope for the content pipeline package. - Fix or document
NETSDK1202inMonoGame.Content.Builder.Editor.Mac.csproj. - Re-enable analyzers for
Tests/Interactive/TestRunners/DesktopGL/MonoGame.DesktopGL.TestRunner.csproj, or replace the wholesale disable with a narrow documented exception.
- Remove
CS0649fromTools/MonoGame.Content.Builder.Editor/MainWindow.cs. - Remove
CA1050fromTools/MonoGame.Tools.Tests/AssetTestClasses.cs, or document why serializer test assets must stay in the global namespace. - Remove generated parser
CS0168fromTools/MonoGame.Effect.Compiler/Effect/TPGParser/Parser.csby regenerating or fixing the generator/template. - Clear
CA2022inexact reads andCA2014loop-local stack allocations. - Clear
CS0169dead fields while preserving required FreeType interop layout fields. - Clear
CS0672/unsuppressedCS0618by aligning obsolete contracts and migrating content-pipeline call sites. - Re-run
MonoGame.Tools.Testsafter simple source cleanup (319 passed, 3 platform-dependent tests skipped).
- Decide policy for copied compatibility files under
MonoGame.Framework/Utilities/System.Numerics.Vectors/. - Remove file-scope
CS1591pragmas from copied numerics files, or document copied-source treatment. - Reduce content pipeline
CS1591warnings from 370 to 0, or intentionally move any remaining exceptions to a narrow documented scope. - Verify generated XML documentation still packs correctly for public NuGet packages.
- Audit
CA1304warnings and classify each site as invariant, ordinal, or user-culture-sensitive. - Audit
CA1305warnings and classify each parse/format site as invariant content format, developer log, or user-visible text. - Fix invariant content-format sites with explicit
CultureInfo.InvariantCulture. - Keep user-visible culture behavior intentional and documented where applicable.
- Clear
CA1304/CA1305in the MGCB editor Linux warning-as-error build. - Clear
CA1304/CA1305in the effect compiler warning-as-error build. - Re-run the focused analyzer build and confirm
CA1304/CA1305are cleared or narrowly justified.
Serialized content, command arguments, external-tool protocols, cache data, and machine-readable paths use invariant or ordinal behavior. User-facing editor and console messages retain the current culture where values are intended for people rather than round-tripping.
Nullable contracts preserve public signatures where practical, annotate genuinely optional values, use semantic defaults only when empty is valid, and fail explicitly at required serialization, reflection, importer, processor, and shader boundaries.
- Establish nullable cleanup rules for public API compatibility, serialization contracts, and content pipeline reflection paths.
- Clean
CS8618non-nullable initialization warnings. - Clean
CS8600,CS8601,CS8602,CS8603,CS8604, andCS8605flow warnings. - Clean
CS8620,CS8621,CS8625, andCS8629nullable argument/value warnings. - Clean
CS8765,CS8767,CS8769, andCS8714override/interface/generic nullability mismatches. - Add or adjust tests for changed null-handling behavior in content pipeline serialization/import paths.
- Decide whether reflection-heavy content loading APIs are supported under trimming/AOT, explicitly unsupported, or supported through annotations/preservation contracts.
- Remove
IL2067suppressions from design-time type converters, or isolate them behind a documented non-trimmable design-time boundary. - Remove
IL2072fromReflectiveReader<T>by adding correct annotations or restructuring reflection use. - Remove
IL2057fromContentTypeReaderManagerby replacing or annotating dynamic type lookup. - Remove
IL2060/IL3050fromContentManager,MultiArrayReader, andReflectionHelpers, or replace with narrow documented exceptions. - Re-run the focused analyzer build and confirm
IL20xx/IL211x/IL3050warnings are cleared or intentionally scoped.
Content loading now exposes truthful RequiresUnreferencedCode/RequiresDynamicCode boundaries,
while registered reader factories remain the trimmed-build path. External references use a loader
delegate created inside that boundary. Arbitrary design-time IPackedVector conversion remains
supported through one method-level IL2067 suppression because TypeConverter.ConvertTo cannot
annotate its override-supplied destination Type with the required constructor preservation.
- Replace obsolete ETC1 enum references in
DefaultTextureProfilewith an explicit compatibility value. - Add analyzer-recognized platform guards for
FontDescriptionProcessor(CA1416). - Remove ignored Android bitmap options from
Texture2D.OpenGL.cs(CA1422,CS0618). - Remove the ignored Android surface-type call from
MonoGameAndroidGameView.cs. - Validate touched platform paths with the relevant backend/platform build or smoke test.
- Focused content-pipeline analyzer build passes with
-p:NoWarn=and SDK analyzers enabled. -
MonoGame.Tools.Testspasses (322 total: 319 passed, 3 skipped). - The Trace downstream solution builds cleanly and all 914 tests pass against the fork.
- The
netstandard2.1native framework target builds with the trim/AOT contracts and exact-read behavior intact. - Touched NuGet packages pack without warnings; content-pipeline XML docs and dependency metadata were inspected.
- Runtime/platform cleanup has backend-specific validation results recorded.
- The Trace
native-runtime-metal-sdl3prerequisite packs mgfxc, generates Vulkan shaders, and links the native runtime without warnings. - Re-run the suppression inventory and update the headline counts in this document.
No diagnostics remain in the focused analyzer build. XML documentation, nullable, and trim/AOT diagnostics are all zero.
The DesktopGL content/editor builds and the netstandard2.1 native framework build pass, and the
downstream Trace solution builds and passes all tests. The unsuppressed macOS editor build passes
for both osx-x64 and osx-arm64, and the generated Apple Silicon app launches with a populated
MGCB Editor window. The unsuppressed net10.0-android framework build passes with zero warnings
using Android API 36 and the workload-provisioned Microsoft OpenJDK 17. A device or emulator was
not required for this compile-time warning validation. The Trace native-runtime-metal-sdl3
prerequisite also passes without warnings, including Cake startup, mgfxc pack/publish, Vulkan
shader generation, Premake generation, and the modern macOS linker.
There are no warning hotspots in the focused analyzer build.
| File | Suppression | Notes |
|---|---|---|
src/NuGetPackages/Directory.Build.props |
NU5128 |
Fixed: package-only wrappers now pack a conventional lib/netstandard2.1/_._ placeholder instead of suppressing the warning. |
MonoGame.Framework.Content.Pipeline/MonoGame.Framework.Content.Pipeline.csproj |
CS1591 |
Fixed: package-restored MonoGame.Tool.* binaries are removed from package content before nuspec generation, so tool payloads such as dxcompiler.dll stay package dependencies instead of becoming contentFiles; CS1591 still hides public XML-doc warnings. |
Tools/MonoGame.Content.Builder.Editor/MonoGame.Content.Builder.Editor.Mac.csproj |
NETSDK1202 |
Fixed: removed the suppression, raised the deployment floor to the .NET 10 workload minimum of macOS 12.0, and disabled trim analysis for the intentionally reflection-driven, untrimmed editor. The unsuppressed dual-RID build and Apple Silicon launch smoke test pass. |
| File | Suppression | Notes |
|---|---|---|
Tests/Interactive/TestRunners/DesktopGL/MonoGame.DesktopGL.TestRunner.csproj |
RunAnalyzersDuringBuild=false, RunAnalyzersDuringLiveAnalysis=false, EnableNETAnalyzers=false |
Fixed: analyzers are re-enabled after clearing the runner/shared interactive-test warnings. |
| File(s) | Suppression | Notes |
|---|---|---|
MonoGame.Framework/Utilities/System.Numerics.Vectors/*.cs |
CS1591 |
Six copied/compatibility numerics files suppress missing XML docs at file scope. Decide whether to keep copied-source treatment or add docs. |
MonoGame.Framework.Content.Pipeline/MonoGame.Framework.Content.Pipeline.csproj |
CS1591 |
Clearing this exposed 370 XML-doc warnings in the focused analyzer run. |
| File(s) | Suppression | Notes |
|---|---|---|
MonoGame.Framework/Design/VectorConversion.cs |
IL2067 |
One method-level boundary preserves arbitrary user-defined IPackedVector activation; the base TypeConverter.ConvertTo contract cannot carry the required destination-type annotation. |
MonoGame.Framework/Utilities/ReflectionHelpers.cs |
IL3050 |
Runtime reflection/AOT path. Needs API annotation or non-AOT boundary decision. |
MonoGame.Framework/Content/ContentReaders/ReflectiveReader.cs |
IL2072 |
Reflective content reader. High-risk area: fixing may require type annotations or design changes. |
MonoGame.Framework/Content/ContentReaders/MultiArrayReader.cs |
IL3050 |
AOT/reflection warning around array creation or generic content reading. |
MonoGame.Framework/Content/ContentTypeReaderManager.cs |
IL2057 |
Dynamic type lookup. Needs content pipeline/runtime preservation strategy. |
MonoGame.Framework/Content/ContentManager.cs |
IL2060;IL3050 |
Reflection activation / AOT warning. Needs trimming contract decision. |
| File(s) | Suppression | Notes |
|---|---|---|
MonoGame.Framework.Content.Pipeline/Graphics/DefaultTextureProfile.cs |
CS0618 |
Fixed: legacy ETC1 input is represented by its stable serialized compatibility value without obsolete member references. |
MonoGame.Framework.Content.Pipeline/Processors/FontDescriptionProcessor.cs |
CA1416 |
Fixed: Windows registry and font-directory paths use analyzer-recognized host OS guards. |
MonoGame.Framework/Platform/Graphics/Texture2D.OpenGL.cs |
CA1422;CS0618 |
Fixed: removed bitmap decode options that are defaulted or ignored on the supported Android API range. |
MonoGame.Framework/Platform/Android/MonoGameAndroidGameView.cs |
CS0618 |
Fixed: removed SurfaceHolder.SetType, which is ignored on the supported Android API range. |
| File | Suppression | Notes |
|---|---|---|
Tools/MonoGame.Effect.Compiler/Effect/TPGParser/Parser.cs |
CS0168 |
Fixed: removed the broad generated-file pragma and the unused generated ParseNode n declarations it was hiding. |
Tools/MonoGame.Content.Builder.Editor/MainWindow.cs |
CS0649 |
Fixed: notification fields were converted to events and verified by the Linux editor warning-as-error build. |
Tools/MonoGame.Tools.Tests/AssetTestClasses.cs |
CA1050 |
Documented exception: serializer XML fixtures use simple global type names such as <Asset Type="TheBasics">; moving helpers into a namespace requires a fixture contract rewrite and verification pass. |
This is not a single refactor. It is several independent cleanup tracks:
| Track | Rough size | Risk |
|---|---|---|
Package warnings (NU5128, NU5100, NETSDK1202) |
Small to medium | Package layout changes can affect NuGet consumers, so validation must include dotnet pack and package inspection. |
Simple source suppressions (CS0649, CA1050, generated-parser CS0168) |
Small | Mostly local, except generated parser changes should avoid hand-edit drift. |
XML docs (CS1591) |
Medium | Mechanically large. Low runtime risk, but docs should be meaningful for public API. |
Globalization analyzers (CA1304, CA1305) |
Medium | Many straightforward InvariantCulture fixes, but content formats and user-facing culture must be distinguished. |
Nullable cleanup (CS86xx, CS876x, CS8714) |
Large | Around 1,504 warning lines in this slice. Requires API intent decisions, nullable annotations, tests, and avoiding behavior changes. |
Trim/AOT cleanup (IL20xx, IL3050, IL211x) |
Medium to large | Smaller count but higher design risk. Reflection-heavy content/runtime APIs may need annotations, preservation contracts, or explicit non-trimmable boundaries. |
| Obsolete/platform compatibility | Medium | Requires platform-specific replacements and validation on OpenGL, Android, and content-pipeline paths. |
The warning count is large enough that cleanup should be done in topic branches by diagnostic family, with focused validation per family. The first high-value pass should be package warnings and simple source suppressions, followed by globalization, then nullable, then trim/AOT.
For this fork, each cleanup pass should at least run:
dotnet build MonoGame.Framework.Content.Pipeline/MonoGame.Framework.Content.Pipeline.csproj \
-p:DisableNativeBuild=True \
-p:NoWarn= \
-p:EnableNETAnalyzers=true \
-p:AnalysisLevel=latest
dotnet test Tools/MonoGame.Tools.Tests/MonoGame.Tools.Tests.csprojPackage-layout cleanup should additionally run dotnet pack for the touched package projects and
inspect the generated .nupkg contents.
Runtime/platform cleanup needs backend-specific validation, not just a content-pipeline build.