Skip to content

Update Microsoft.CodeAnalysis.Analyzers to a release version#82719

Open
JoeRobich wants to merge 6 commits intorelease/dev18.3from
dev/jorobich/update-release-version
Open

Update Microsoft.CodeAnalysis.Analyzers to a release version#82719
JoeRobich wants to merge 6 commits intorelease/dev18.3from
dev/jorobich/update-release-version

Conversation

@JoeRobich
Copy link
Member

@JoeRobich JoeRobich commented Mar 12, 2026

The Microsoft.CodeAnalysis.Analyzers package is a dependency of the Microsoft.CodeAnalysis packages. For the 5.3.0 release the analyzer dependency was set to a prerelease version. This is causing issues with users SBOM scanning as they cannot use prerelease packages in their deployed products. (See comment)

Microsoft Reviewers: Open in CodeFlow

@JoeRobich JoeRobich requested a review from a team as a code owner March 12, 2026 07:05
<SystemCommandLineVersion>$(SystemCommandLinePackageVersion)</SystemCommandLineVersion>
<!-- dotnet-roslyn dependencies -->
<MicrosoftCodeAnalysisVersion>$(MicrosoftCodeAnalysisPackageVersion)</MicrosoftCodeAnalysisVersion>
<MicrosoftCodeAnalysisAnalyzersVersion>$(MicrosoftCodeAnalysisAnalyzersPackageVersion)</MicrosoftCodeAnalysisAnalyzersVersion>
Copy link
Member

Choose a reason for hiding this comment

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

Why not change the value of MicrosoftCodeAnalysisAnalyzersPackageVersion instead? (and perhaps also the corresponding values in version.details.xml)

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't want to change the SourceBuild information. Maybe conditionally setting the version will be more clean.

Copy link
Member

@jjonescz jjonescz Mar 12, 2026

Choose a reason for hiding this comment

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

But manual changes in this file will be overridden on next bot update. I guess it's fine since we just want to have a build to publish and then we don't care...

Copy link
Member

Choose a reason for hiding this comment

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

(Otherwise if you want I guess it would be better to just move this <MicrosoftCodeAnalysisAnalyzersVersion Condition="Condition="'$(DotNetBuildSourceOnly)' != 'true'">5.3.0</MicrosoftCodeAnalysisAnalyzersVersion> line to some other file that is not bot-managed.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure. To Packages.props it goes!

Copy link
Member

Choose a reason for hiding this comment

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

@JoeRobich @jjonescz source build will override the version so you can just update the Version.Details.xml/.props

Copy link
Member

Choose a reason for hiding this comment

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

But then maestro could overwrite that file, no?

Copy link
Member

Choose a reason for hiding this comment

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

That depends on the subscription, but it looks like we have a cycle here if Microsoft.CodeAnalysis.Analyzers is a dependency of Microsoft.CodeAnalysis but is built in the sdk repo after roslyn.

/cc @dotnet/source-build

Copy link
Member Author

@JoeRobich JoeRobich Mar 13, 2026

Choose a reason for hiding this comment

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

For this servicing branch I would like to leave it as is. I think our goal for main should be to move it to project references during the build with the appropriate package dependency when packed.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am taking advice on that last part.

@JoeRobich JoeRobich requested a review from a team as a code owner March 12, 2026 16:54
Copy link
Member

@333fred 333fred left a comment

Choose a reason for hiding this comment

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

Someone from @dotnet/product-construction should probably take a look at this as well.

we use for other analyzers to ensure it stays on a release version.
-->
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="$(MicrosoftCodeAnalysisAnalyzersVersion)" />
<PackageVersion Condition="'$(DotNetBuildSourceOnly)' != 'true'" Include="Microsoft.CodeAnalysis.Analyzers" Version="5.3.0" />
Copy link
Member

Choose a reason for hiding this comment

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

I see this is targeting dev18.3 as a branch -- do we need to do something similar for other branches, or was something better done in later branches and this is a unique problem for this branch?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think ideally we wouldn't be behind. We would use project references for our build, but I need to talk to someone more knowledgeable here since Microsoft.CodeAnalysis.Analyzer.Package is a project that packages other analyzer projects.

Could see making the same change in main so if we aren't able to work out the details we don't regress.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants