Skip to content

Conversation

jjonescz
Copy link
Member

@jjonescz jjonescz commented Aug 26, 2025

Follow up on #42861.

  • Added opt out env var.
  • Set SystemComponent=true so the extension doesn't show up in the list of installed VS extensions.
  • Added logging.
  • Moved the deployed analyzers under CommonExtensions and removed version numbers from the layout (this was in preparation for enabling NGEN which was determined to not be needed after all, but I still think the new layout is better).

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the analyzer redirecting VS extension to complete the implementation following up on a previous PR. Key changes include adding an opt-out environment variable, improving the VS extension configuration, and restructuring the analyzer layout.

  • Added logging capabilities and opt-out environment variable (DOTNET_ANALYZER_REDIRECTING)
  • Restructured analyzer deployment layout to remove version numbers from directories
  • Updated VS extension to be a system component that doesn't appear in installed extensions list

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/Microsoft.Net.Sdk.AnalyzerRedirecting.Tests/SdkAnalyzerAssemblyRedirectorTests.cs Updated tests to use new metadata-based version tracking instead of version directories
src/Tasks/sdk-tasks/sdk-tasks.InTree.targets Added new MSBuild task ProcessRuntimeAnalyzerVersions for version extraction
src/Tasks/sdk-tasks/ProcessRuntimeAnalyzerVersions.cs New task to extract version numbers and create metadata JSON file
src/Tasks/sdk-tasks/GenerateRuntimeAnalyzersSWR.cs Updated layout paths and added metadata.json file inclusion
src/Microsoft.Net.Sdk.AnalyzerRedirecting/source.extension.vsixmanifest Updated to VS 19.0 compatibility and system component configuration
src/Microsoft.Net.Sdk.AnalyzerRedirecting/SdkAnalyzerAssemblyRedirector.cs Added logging, opt-out mechanism, and updated to use metadata-based version lookup
src/Microsoft.Net.Sdk.AnalyzerRedirecting/Microsoft.Net.Sdk.AnalyzerRedirecting.csproj Added System.Text.Json dependency for metadata processing
src/Layout/VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers/VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers.proj Updated build process to use new version extraction and VS extension configuration
documentation/general/analyzer-redirecting.md Updated documentation to reflect new metadata-based approach

@jjonescz jjonescz marked this pull request as ready for review September 9, 2025 13:31
@jjonescz jjonescz requested a review from JoeRobich September 17, 2025 13:43
@jjonescz
Copy link
Member Author

jjonescz commented Sep 23, 2025

@JoeRobich @RikkiGibson @333fred for reviews, thanks

Btw, I think I can merge this into release/10.0.1xx as it's infra-only change because the package doesn't ship inside SDK, it is only for VS insertion - and that also needs a special PR to "activate" this new extension, until then it won't be inserted automatically alongside .NET.

@jjonescz jjonescz merged commit 35c5339 into dotnet:release/10.0.1xx Sep 26, 2025
27 checks passed
@jjonescz jjonescz deleted the analyzer-redirecting-2 branch September 26, 2025 09:55
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