Skip to content

Pin analyzers that ship in the SDK (#36690) #36747

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

Merged
merged 1 commit into from
Sep 20, 2021

Conversation

pranavkm
Copy link
Contributor

@pranavkm pranavkm commented Sep 20, 2021

  • Pin analyzers that ship in the SDK

Customer impact

ASP.NET Core produces a few analyzer assemblies that are shipped as part of the .NET SDK. These analyzers are added to web projects targeting 3.1 and newer.
In 6.0, we (unintentionally) bumped the version of Microsoft.CodeAnalysis that these projects referenced to a 4.0 version. This causes warnings when opening a 3.1 or 5.0 app in VS 2019 as it does not support these versions.

Additionally update the version of Microsoft.CodeAnalysis.* packages used in tests, Razor, and framework analyzers that are only expected to run with VS 2020 to a more recent build. This is largely book-keeping, but allows us to write a test for file scoped namespaces.

Regression

The regression was introduced in 6.0-p7

Testing

Manually tested against a fresh VS 2019 install. Verified analyzers continue to work in 6.0 in apps that use newer C# features

Issue

Fixes #36552

* Pin analyzers that ship in the SDK

ASP.NET Core produces a few analyzer assemblies that are shipped as part of the .NET SDK. These analyzers are added to web projects targeting 3.1 and newer.
In 6.0, we (unintentionally) bumped the version of Microsoft.CodeAnalysis that these projects referenced to a 4.0 version. This causes warnings when opening
a 3.1 or 5.0 app in VS 2019 as it does not support these versions.

Additionally update the version of Microsoft.CodeAnalysis.* packages used in tests, Razor, and framework analyzers that are only expected to run with VS 2020 to a more recent build. This is largely book-keeping, but allows us
to write a test for file scoped namespaces.

Fixes #36552
@pranavkm pranavkm requested review from dougbu, javiercn, Pilchie and a team as code owners September 20, 2021 16:14
@pranavkm
Copy link
Contributor Author

@Pilchie for porting to 6.0. I'm going to bring this up as a possible 6.0-rc2 candidate too as we have at least one user report of this #36736

Copy link
Contributor

@dougbu dougbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pilchie since this is just a version change (similar to a dependency PR from Maestro++), should we treat it as tell-mode


<MicrosoftCodeAnalysisCommonVersion>4.0.0-4.final</MicrosoftCodeAnalysisCommonVersion>
<MicrosoftCodeAnalysisCSharpVersion>4.0.0-4.final</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.0.0-4.final</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note these versions must change again before RTM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup - #36682

@Pilchie
Copy link
Member

Pilchie commented Sep 20, 2021

Approved for GA, I think it's asking Tactics for RC2. @dougbu - consider this is explicitly fixing a customer reported issue, and forking the versions, it's more than just a dependency update.

@Pilchie Pilchie added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Sep 20, 2021
@pranavkm
Copy link
Contributor Author

@dotnet/aspnet-build could you merge this?

@dougbu dougbu merged commit 2063967 into release/6.0 Sep 20, 2021
@dougbu dougbu deleted the prkrishn/port-analyzer-fix branch September 20, 2021 18:43
@ghost ghost added this to the 6.0.0 milestone Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants