microsoft / SizeBench

SizeBench is a binary size investigation tool for Windows
MIT License
103 stars 14 forks source link

Get to a clean build with latest VS 2022 and .NET 8 SDKs #27

Closed Austin-Lamb closed 9 months ago

Austin-Lamb commented 9 months ago

Why is this change being made?

With the latest Visual Studio 2022 and .NET 8 SDKs, some Roslyn rules went from nothing to suggestion, and because SizeBench cranks most things up to error, this causes build errors. So this gets us back to a clean build on the latest SDK.

Briefly summarize what changed

There's two fixes:

  1. If it's a trivial fix, just fix it (e.g. functions that should be static because they don't touch instance data)
  2. CA2208 has a regression in the .NET 8 SDK with false positives (see https://github.com/dotnet/roslyn-analyzers/issues/6863), so disable that one in the GUI project. It's low value there anyway.

How was the change tested?

The build is the main test, but of course all existing tests also pass.

PR Checklist