Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS SDK's Code Analyzers change target to .NET Standard 2.0 #2998

Closed
normj opened this issue Jul 11, 2023 · 3 comments
Closed

AWS SDK's Code Analyzers change target to .NET Standard 2.0 #2998

normj opened this issue Jul 11, 2023 · 3 comments

Comments

@normj
Copy link
Member

normj commented Jul 11, 2023

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.

  • Update all code analyzers projects to replace the target framework from .NET Framework 4.5 to .NET Standard 2.0
  • The Microsoft.CodeAnalysis reference will be set to 3.0.0 which makes Visual Studio 2019 RTM the minimum for the analyzers to work
  • All versions of the SDK packages will be set to 3.7.200 to make it easy to identify when this happen. We are not updating to 3.9 because minor version bumps require significant effort and coordination across many products. Since the runtime SDK isn't changing the effort doesn't seem warranted.
  • The change log will explicitly call out this change for version 3.7.200

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.

@normj normj added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. Announcement and removed feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jul 11, 2023
@normj normj pinned this issue Jul 11, 2023
@PeterBenko
Copy link

Sounds good - knowing what the root cause was and knowing the 17.6 requirement should be enough for us 👍

@dscpinheiro
Copy link
Contributor

We just released the Code Analyzer target change to .NET Standard 2.0. As Norm discussed on the announcement, we:

Please let us know if you see any issues.

@github-actions
Copy link

github-actions bot commented Oct 9, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants