AWS SDK's Code Analyzers change target to .NET Standard 2.0 (original) (raw)

We are in the process of rebuilding our SDK's build infrastructure. As part of that we need to change the SDK's code analyzers to target .NET Standard 2.0 so we can build them on Linux. This is important to get our build times of the entire SDK to an acceptable level for our daily release cycle.

Recently we released a version of the SDK updating the target to .NET Standard 2.0. This changed caused a new compiler warning for environments that did not have Visual Studio 2022 version 17.6 installed. The warning was caused because the retargeting change involved a package reference of Microsoft.CodeAnalysis version 4.6.0 which requires Visual Studio 2022 version 17.6. For build systems that treat warnings as errors this caused a build break. The new warning was unintended and we reverted the change of targeting .NET Standard 2.0 for the code analyzers. Below is the reported GitHub issues.

Within the next week or so we will make the change to .NET Standard 2.0 again using the following process which matches what we see in other community code analyzers.

Users using Visual Studio 2017 or older can still continue using the SDK but they will get warning CS8032 for the code analyzers failing to run. You will need to either ignore or suppress the warning.

We will also be updating the SDK's GitHub README file with a new section about the code analyzers, documenting our supported VS targets for the code analyzers and what to do if you are using older tooling.

@oshea00, @slang25, @martincostello, @KevinD-87, @pablogdnd, @PeterBenko - You all commented on the issues when we first attempted this. I would really appreciate hearing your feedback on this approach and any concerns you have.