@@ -19,11 +19,12 @@ Targeting an SDK (and hence also loading analyzers) with newer major version in
1919
2020## Overview
2121
22- - The SDK will contain a VSIX with the analyzer DLLs and an MEF-exported implementation of ` IAnalyzerAssemblyRedirector ` .
22+ - The SDK will deploy analyzer DLLs and Roslyn will deploy an implementation of ` IAnalyzerAssemblyRedirector `
23+ (could be deployed by SDK but we are saving on analyzer loads and Roslyn already has a VSIX with a DLL).
2324 Implementations of this interface are imported by Roslyn and can redirect analyzer DLL loading.
2425
25- - The SDK's implementation of ` IAnalyzerAssemblyRedirector ` will redirect any analyzer DLL matching some pattern
26- to the corresponding DLL deployed via the VSIX .
26+ - That implementation of ` IAnalyzerAssemblyRedirector ` will redirect any analyzer DLL matching some pattern
27+ to the corresponding DLL deployed with VS .
2728 Details of this process are described below.
2829
2930- Note that when ` IAnalyzerAssemblyRedirector ` is involved, Roslyn is free to not use shadow copy loading and instead load the DLLs directly.
@@ -33,7 +34,7 @@ Targeting an SDK (and hence also loading analyzers) with newer major version in
3334
3435## Details
3536
36- The VSIX contains some analyzers, for example:
37+ The VS deployment contains some analyzers, for example:
3738
3839```
3940AspNetCoreAnalyzers\analyzers\dotnet\cs\Microsoft.AspNetCore.App.Analyzers.dll
@@ -69,7 +70,7 @@ C:\Program Files\dotnet\sdk\9.0.100-preview.5.24307.3\Sdks\Microsoft.NET.Sdk\ana
6970will be redirected to
7071
7172```
72- {VSIX }\SDKAnalyzers\Sdks\Microsoft.NET.Sdk\analyzers\Microsoft.CodeAnalysis.NetAnalyzers.dll
73+ {InstallDir }\SDKAnalyzers\Sdks\Microsoft.NET.Sdk\analyzers\Microsoft.CodeAnalysis.NetAnalyzers.dll
7374```
7475
7576where ` metadata.json ` has ` "SDKAnalyzers": "9.0.100-dev" ` , because
@@ -83,6 +84,5 @@ Analyzers that cannot be matched will continue to be loaded from the SDK
8384### Implementation
8485
8586Analyzer DLLs are contained in transport package ` VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers ` .
86- The redirecting logic lives in "system" VS extension ` Microsoft.Net.Sdk.AnalyzerRedirecting ` .
8787
8888[ torn-sdk ] : https://github.com/dotnet/sdk/issues/42087
0 commit comments