Skip to content

Commit 4dc9d20

Browse files
authored
[9.0.3xx] Add analyzer redirecting VSIX (#47021)
1 parent 8b956dc commit 4dc9d20

21 files changed

+541
-2
lines changed

Directory.Packages.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@
6565
<PackageVersion Include="Microsoft.TestPlatform.Build" Version="$(MicrosoftTestPlatformBuildPackageVersion)" />
6666
<PackageVersion Include="Microsoft.TestPlatform.CLI" Version="$(MicrosoftTestPlatformCLIPackageVersion)" />
6767
<PackageVersion Include="Microsoft.VisualStudio.Composition" Version="17.4.16" />
68+
<PackageVersion Include="Microsoft.VisualStudio.Sdk" Version="17.2.32505.173" />
69+
<PackageVersion Include="Microsoft.VSSDK.BuildTools" Version="17.11.435" />
6870
<PackageVersion Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="$(MicrosoftVisualStudioSetupConfigurationInteropVersion)" />
6971
<PackageVersion Include="Microsoft.VisualStudio.SolutionPersistence" Version="1.0.52" />
7072
<PackageVersion Include="Microsoft.Web.Deployment" Version="$(WebDeploymentPackageVersion)" />

NuGet.config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
<add key="dotnet-tools-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json" />
5454
<add key="dotnet-libraries" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json" />
5555
<add key="dotnet-libraries-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries-transport/nuget/v3/index.json" />
56+
<add key="vssdk" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk/nuget/v3/index.json" />
57+
<add key="vssdk-archived" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk-archived/nuget/v3/index.json" />
5658
<add key="vs-impl" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json" />
5759
<!-- Used for Rich Navigation indexing task -->
5860
<add key="richnav" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-buildservices/nuget/v3/index.json" />

eng/Signing.props

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
<FileSignInfo Include="MessagePack.Annotations.dll" CertificateName="$(ExternalCertificateId)" />
6868
<FileSignInfo Include="MessagePack.dll" CertificateName="$(ExternalCertificateId)" />
6969
<FileSignInfo Include="Nerdbank.Streams.dll" CertificateName="$(ExternalCertificateId)" />
70-
<FileSignInfo Include="StreamJsonRpc.dll" CertificateName="$(ExternalCertificateId)" />
7170
<FileSignInfo Include="Newtonsoft.Json.dll" CertificateName="$(ExternalCertificateId)" />
7271
<FileSignInfo Include="CommandLine.dll" CertificateName="$(ExternalCertificateId)" />
7372
<FileSignInfo Include="FluentAssertions.dll" CertificateName="$(ExternalCertificateId)" />
@@ -81,6 +80,10 @@
8180
<FileSignInfo Include="Valleysoft.DockerCredsProvider.dll" CertificateName="$(ExternalCertificateId)" />
8281
</ItemGroup>
8382

83+
<ItemGroup>
84+
<FileSignInfo Include="StreamJsonRpc.dll" CertificateName="MicrosoftSHA2" />
85+
</ItemGroup>
86+
8487
<!-- Filter out any test packages from ItemsToSign -->
8588
<ItemGroup>
8689
<ItemsToSignPostBuild Remove="*tests*.nupkg" />

eng/Versions.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
compiler API targeted by analyzer assemblies. This is mostly an issue on source-build as
2727
in that build mode analyzer assemblies always target the live compiler API. -->
2828
<UsingToolMicrosoftNetCompilers Condition="'$(DotNetBuildSourceOnly)' == 'true'">true</UsingToolMicrosoftNetCompilers>
29+
<UsingToolVSSDK>true</UsingToolVSSDK>
2930
<MicrosoftIORedistPackageVersion>6.0.1</MicrosoftIORedistPackageVersion>
3031
</PropertyGroup>
3132
<PropertyGroup Label="Servicing version information">

sdk.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.HotReload.
520520
EndProject
521521
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Microsoft.DotNet.HotReload.Agent.Data", "src\BuiltInTools\HotReloadAgent.Data\Microsoft.DotNet.HotReload.Agent.Data.shproj", "{0762B436-F4B0-4008-9097-BB5FF6BD84AF}"
522522
EndProject
523+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Net.Sdk.AnalyzerRedirecting", "src\Microsoft.Net.Sdk.AnalyzerRedirecting\Microsoft.Net.Sdk.AnalyzerRedirecting.csproj", "{27BBE29B-CE6F-401F-B3CF-B07DC556FAD1}"
524+
EndProject
525+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Net.Sdk.AnalyzerRedirecting.Tests", "test\Microsoft.Net.Sdk.AnalyzerRedirecting.Tests\Microsoft.Net.Sdk.AnalyzerRedirecting.Tests.csproj", "{234BE46E-4AD6-485C-B0D3-E704EF504312}"
526+
EndProject
523527
Global
524528
GlobalSection(SolutionConfigurationPlatforms) = preSolution
525529
Debug|Any CPU = Debug|Any CPU
@@ -986,6 +990,14 @@ Global
986990
{3DF5A9B8-6F90-4CFB-4518-0E97982B6748}.Debug|Any CPU.Build.0 = Debug|Any CPU
987991
{3DF5A9B8-6F90-4CFB-4518-0E97982B6748}.Release|Any CPU.ActiveCfg = Release|Any CPU
988992
{3DF5A9B8-6F90-4CFB-4518-0E97982B6748}.Release|Any CPU.Build.0 = Release|Any CPU
993+
{27BBE29B-CE6F-401F-B3CF-B07DC556FAD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
994+
{27BBE29B-CE6F-401F-B3CF-B07DC556FAD1}.Debug|Any CPU.Build.0 = Debug|Any CPU
995+
{27BBE29B-CE6F-401F-B3CF-B07DC556FAD1}.Release|Any CPU.ActiveCfg = Release|Any CPU
996+
{27BBE29B-CE6F-401F-B3CF-B07DC556FAD1}.Release|Any CPU.Build.0 = Release|Any CPU
997+
{234BE46E-4AD6-485C-B0D3-E704EF504312}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
998+
{234BE46E-4AD6-485C-B0D3-E704EF504312}.Debug|Any CPU.Build.0 = Debug|Any CPU
999+
{234BE46E-4AD6-485C-B0D3-E704EF504312}.Release|Any CPU.ActiveCfg = Release|Any CPU
1000+
{234BE46E-4AD6-485C-B0D3-E704EF504312}.Release|Any CPU.Build.0 = Release|Any CPU
9891001
EndGlobalSection
9901002
GlobalSection(SolutionProperties) = preSolution
9911003
HideSolutionNode = FALSE
@@ -1169,6 +1181,8 @@ Global
11691181
{FA3C7F91-42A2-45AD-897C-F646B081016C} = {71A9F549-0EB6-41F9-BC16-4A6C5007FC91}
11701182
{3DF5A9B8-6F90-4CFB-4518-0E97982B6748} = {71A9F549-0EB6-41F9-BC16-4A6C5007FC91}
11711183
{0762B436-F4B0-4008-9097-BB5FF6BD84AF} = {71A9F549-0EB6-41F9-BC16-4A6C5007FC91}
1184+
{27BBE29B-CE6F-401F-B3CF-B07DC556FAD1} = {22AB674F-ED91-4FBC-BFEE-8A1E82F9F05E}
1185+
{234BE46E-4AD6-485C-B0D3-E704EF504312} = {580D1AE7-AA8F-4912-8B76-105594E00B3B}
11721186
EndGlobalSection
11731187
GlobalSection(ExtensibilityGlobals) = postSolution
11741188
SolutionGuid = {FB8F26CE-4DE6-433F-B32A-79183020BBD6}
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
// Copyright (c) .NET Foundation and contributors. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
namespace Microsoft.DotNet.Cli.Build
5+
{
6+
public class GenerateRuntimeAnalyzersSWR : Task
7+
{
8+
[Required]
9+
public string RuntimeAnalyzersLayoutDirectory { get; set; }
10+
11+
[Required]
12+
public string OutputFile { get; set; }
13+
14+
public override bool Execute()
15+
{
16+
StringBuilder sb = new StringBuilder(SWR_HEADER);
17+
18+
// NOTE: Keep in sync with SdkAnalyzerAssemblyRedirector.
19+
// This is intentionally short to avoid long path problems.
20+
const string installDir = @"DotNetRuntimeAnalyzers";
21+
22+
AddFolder(sb,
23+
@"AnalyzerRedirecting",
24+
@"Common7\IDE\CommonExtensions\Microsoft\AnalyzerRedirecting",
25+
filesToInclude:
26+
[
27+
"Microsoft.Net.Sdk.AnalyzerRedirecting.dll",
28+
"Microsoft.Net.Sdk.AnalyzerRedirecting.pkgdef",
29+
"extension.vsixmanifest",
30+
]);
31+
32+
AddFolder(sb,
33+
@"AspNetCoreAnalyzers",
34+
@$"{installDir}\AspNetCoreAnalyzers");
35+
36+
AddFolder(sb,
37+
@"NetCoreAnalyzers",
38+
@$"{installDir}\NetCoreAnalyzers");
39+
40+
AddFolder(sb,
41+
@"WindowsDesktopAnalyzers",
42+
@$"{installDir}\WindowsDesktopAnalyzers");
43+
44+
AddFolder(sb,
45+
@"SDKAnalyzers",
46+
@$"{installDir}\SDKAnalyzers");
47+
48+
AddFolder(sb,
49+
@"WebSDKAnalyzers",
50+
@$"{installDir}\WebSDKAnalyzers");
51+
52+
File.WriteAllText(OutputFile, sb.ToString());
53+
54+
return true;
55+
}
56+
57+
private void AddFolder(StringBuilder sb, string relativeSourcePath, string swrInstallDir, bool ngenAssemblies = false, IEnumerable<string> filesToInclude = null)
58+
{
59+
string sourceFolder = Path.Combine(RuntimeAnalyzersLayoutDirectory, relativeSourcePath);
60+
61+
// If files were specified explicitly, check that they exist.
62+
if (filesToInclude != null)
63+
{
64+
foreach (var file in filesToInclude)
65+
{
66+
var path = Path.Combine(sourceFolder, file);
67+
if (!File.Exists(path))
68+
{
69+
throw new InvalidOperationException($"File not found: {path}");
70+
}
71+
}
72+
}
73+
74+
IEnumerable<string> files = filesToInclude ??
75+
Directory.GetFiles(sourceFolder)
76+
.Where(static f =>
77+
{
78+
var extension = Path.GetExtension(f);
79+
return !extension.Equals(".pdb", StringComparison.OrdinalIgnoreCase) &&
80+
!extension.Equals(".swr", StringComparison.OrdinalIgnoreCase) &&
81+
!Path.GetFileName(f).Equals("_._");
82+
});
83+
84+
if (files.Any())
85+
{
86+
sb.Append(@"folder ""InstallDir:\");
87+
sb.Append(swrInstallDir);
88+
sb.AppendLine(@"\""");
89+
90+
foreach (var file in files)
91+
{
92+
var fileName = Path.GetFileName(file);
93+
94+
sb.Append(@" file source=""$(PkgVS_Redist_Common_Net_Core_SDK_RuntimeAnalyzers)\");
95+
sb.Append(Path.Combine(relativeSourcePath, fileName));
96+
sb.Append('"');
97+
98+
if (ngenAssemblies && file.EndsWith(".dll", StringComparison.OrdinalIgnoreCase))
99+
{
100+
sb.Append(@" vs.file.ngenApplications=""[installDir]\Common7\IDE\vsn.exe""");
101+
}
102+
103+
sb.AppendLine();
104+
}
105+
106+
sb.AppendLine();
107+
}
108+
109+
// Don't go to sub-folders if the list of files was explicitly specified.
110+
if (filesToInclude != null)
111+
{
112+
return;
113+
}
114+
115+
foreach (var subfolder in Directory.GetDirectories(sourceFolder))
116+
{
117+
string subfolderName = Path.GetFileName(subfolder);
118+
string newRelativeSourcePath = Path.Combine(relativeSourcePath, subfolderName);
119+
string newSwrInstallDir = Path.Combine(swrInstallDir, subfolderName);
120+
121+
// Don't propagate ngenAssemblies to subdirectories.
122+
AddFolder(sb, newRelativeSourcePath, newSwrInstallDir);
123+
}
124+
}
125+
126+
private static readonly string SWR_HEADER = @"use vs
127+
128+
package name=Microsoft.Net.Core.SDK.RuntimeAnalyzers
129+
version=$(ProductsBuildVersion)
130+
vs.package.internalRevision=$(PackageInternalRevision)
131+
132+
";
133+
}
134+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
2+
<metadata>
3+
<id>VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers</id>
4+
<version>1.0.0</version>
5+
<title>VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers</title>
6+
<authors>Microsoft</authors>
7+
<owners>Microsoft</owners>
8+
<licenseUrl>https://www.microsoft.com/net/dotnet_library_license.htm</licenseUrl>
9+
<projectUrl>https://github.com/dotnet/sdk</projectUrl>
10+
<requireLicenseAcceptance>true</requireLicenseAcceptance>
11+
<description>Analyzers and generators from the runtime and SDK for VS insertion</description>
12+
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
13+
</metadata>
14+
<files>
15+
<file src="$PAYLOAD_FILES$\**\*" />
16+
</files>
17+
</package>

src/Installer/redist-installer/redist-installer.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<Import Project="targets\Crossgen.targets" />
4545
<Import Project="targets\GenerateLayout.targets" />
4646
<Import Project="targets\GenerateMSBuildExtensions.targets" Condition="'$(PackInstaller)' != 'false'"/>
47+
<Import Project="targets\GenerateRuntimeAnalyzers.targets" Condition="'$(PackInstaller)' != 'false'"/>
4748
<Import Project="targets\FileExtensions.targets" />
4849
<Import Project="targets\GenerateArchives.targets" Condition="'$(PackInstaller)' != 'false'"/>
4950
<Import Project="targets\GenerateMSIs.targets" />

src/Installer/redist-installer/targets/BuildCoreSdkTasks.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<UsingTask TaskName="ExtractArchiveToDirectory" AssemblyFile="$(CoreSdkTaskDll)" />
3333
<UsingTask TaskName="GenerateDefaultRuntimeFrameworkVersion" AssemblyFile="$(CoreSdkTaskDll)" />
3434
<UsingTask TaskName="GenerateMSBuildExtensionsSWR" AssemblyFile="$(CoreSdkTaskDll)" />
35+
<UsingTask TaskName="GenerateRuntimeAnalyzersSWR" AssemblyFile="$(CoreSdkTaskDll)" />
3536
<UsingTask TaskName="GenerateMsiVersionFromFullVersion" AssemblyFile="$(CoreSdkTaskDll)" />
3637
<UsingTask TaskName="GenerateSdkRuntimeIdentifierChain" AssemblyFile="$(CoreSdkTaskDll)" />
3738
<UsingTask TaskName="GetDependencyInfo" AssemblyFile="$(CoreSdkTaskDll)" />

src/Installer/redist-installer/targets/GenerateMSIs.targets

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
<SdkMSBuildExtensionsNupkgFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.$(FullNugetVersion).nupkg</SdkMSBuildExtensionsNupkgFile>
3434
<SdkMSBuildExtensionsSwrFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.swr</SdkMSBuildExtensionsSwrFile>
3535

36+
<SdkRuntimeAnalyzersNuspecFile>$(SdkPkgSourcesRootDirectory)/VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers.nuspec</SdkRuntimeAnalyzersNuspecFile>
37+
<SdkRuntimeAnalyzersNupkgFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers.$(FullNugetVersion).nupkg</SdkRuntimeAnalyzersNupkgFile>
38+
<SdkRuntimeAnalyzersSwrFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers.swr</SdkRuntimeAnalyzersSwrFile>
39+
3640
<VSTemplateLocatorLayoutPath>$(ArtifactsDir)bin/VSTemplateLocator/$(Configuration)</VSTemplateLocatorLayoutPath>
3741
<VSTemplateLocatorNuspecFile>$(SdkPkgSourcesRootDirectory)/VS.Redist.Common.Net.Core.SDK.VSTemplateLocator.nuspec</VSTemplateLocatorNuspecFile>
3842
<VSTemplateLocatorNupkgFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.VSTemplateLocator.$(FullNugetVersion).nupkg</VSTemplateLocatorNupkgFile>
@@ -443,6 +447,27 @@
443447
'$(SdkMSBuildExtensionsNupkgFile)'" />
444448
</Target>
445449

450+
<Target Name="GenerateRuntimeAnalyzersNupkg"
451+
DependsOnTargets="GenerateLayout;MsiTargetsSetupInputOutputs"
452+
Condition=" '$(OS)' == 'Windows_NT' And '$(Architecture)' == 'x64' And '$(DotNetBuild)' != 'true' "
453+
Inputs="$(RuntimeAnalyzersLayoutDirectory)/**/*;
454+
$(SdkRuntimeAnalyzersNuspecFile);
455+
$(GenerateNupkgPowershellScript)"
456+
Outputs="$(SdkRuntimeAnalyzersNupkgFile);$(SdkRuntimeAnalyzersSwrFile)">
457+
<GenerateRuntimeAnalyzersSWR RuntimeAnalyzersLayoutDirectory="$(RuntimeAnalyzersLayoutDirectory)"
458+
OutputFile="$(SdkRuntimeAnalyzersSwrFile)" />
459+
460+
<!-- Include the swr file in the nuget package for VS authoring -->
461+
<Copy SourceFiles="$(SdkRuntimeAnalyzersSwrFile)" DestinationFolder="$(RuntimeAnalyzersLayoutDirectory)" />
462+
463+
<Exec Command="powershell -NoProfile -NoLogo $(GenerateNupkgPowershellScript) ^
464+
'$(ArtifactsDir)' ^
465+
'$(RuntimeAnalyzersLayoutDirectory.TrimEnd('\'))' ^
466+
'$(FullNugetVersion)' ^
467+
'$(SdkRuntimeAnalyzersNuspecFile)' ^
468+
'$(SdkRuntimeAnalyzersNupkgFile)'" />
469+
</Target>
470+
446471
<!--
447472
This project references assets from multiple architectures, so it can't be built until we have a join point job that can pull assets from multiple legs.
448473
https://github.com/dotnet/source-build/issues/4336
@@ -474,6 +499,7 @@
474499
GenerateTemplatesNupkgs;
475500
GenerateSdkPlaceholderNupkg;
476501
GenerateSdkMSBuildExtensionsNupkg;
502+
GenerateRuntimeAnalyzersNupkg;
477503
GenerateVSTemplateLocatorNupkg"
478504
Condition=" '$(OS)' == 'Windows_NT' and '$(Architecture)' != 'arm' " />
479505

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<RuntimeAnalyzersLayoutDirectory>$(ArtifactsBinDir)$(Configuration)\RuntimeAnalyzers</RuntimeAnalyzersLayoutDirectory>
5+
</PropertyGroup>
6+
7+
</Project>

src/Layout/redist/redist.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<Import Project="targets\GenerateArchive.targets" />
2828
<Import Project="targets\OverlaySdkOnLKG.targets" Condition="'$(DotNetBuild)' != 'true'" />
2929
<Import Project="targets\MSBuildExtensions.targets" />
30+
<Import Project="targets\RuntimeAnalyzers.targets" />
3031

3132
<ItemGroup>
3233
<PackageReference Include="NuGet.Build.Tasks" />

src/Layout/redist/targets/GenerateLayout.targets

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@
131131

132132
</Target>
133133

134+
<Target Name="PublishRuntimeAnalyzers"
135+
DependsOnTargets="GenerateRuntimeAnalyzers"
136+
AfterTargets="OverlaySdkOnLKG">
137+
<Copy SourceFiles="@(RuntimeAnalyzersContent)"
138+
DestinationFiles="@(RuntimeAnalyzersContent->'$(ArtifactsBinDir)$(Configuration)\RuntimeAnalyzers\%(DeploymentSubpath)\%(RecursiveDir)%(Filename)%(Extension)')" />
139+
</Target>
140+
134141
<Target Name="PublishNetSdks"
135142
BeforeTargets="Build">
136143
<ItemGroup>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<RuntimeAnalyzersSourceRoot>$(ArtifactsBinDir)redist\$(Configuration)\dotnet\</RuntimeAnalyzersSourceRoot>
5+
<NetCoreRuntimeAnalyzersSubPath>packs\Microsoft.NetCore.App.Ref\*\analyzers</NetCoreRuntimeAnalyzersSubPath>
6+
<WindowsDesktopRuntimeAnalyzersSubPath>packs\Microsoft.WindowsDesktop.App.Ref\*\analyzers</WindowsDesktopRuntimeAnalyzersSubPath>
7+
<AspNetCoreRuntimeAnalyzersSubPath>packs\Microsoft.AspNetCore.App.Ref\*\analyzers</AspNetCoreRuntimeAnalyzersSubPath>
8+
<SDKAnalyzersSubPath>sdk\*\Sdks\Microsoft.NET.Sdk\analyzers</SDKAnalyzersSubPath>
9+
<WebSDKAnalyzersSubPath>sdk\*\Sdks\Microsoft.NET.Sdk.Web\analyzers</WebSDKAnalyzersSubPath>
10+
</PropertyGroup>
11+
12+
<Target Name="GenerateRuntimeAnalyzers" AfterTargets="OverlaySdkOnLKG">
13+
14+
<ItemGroup>
15+
<RuntimeAnalyzersContent Include="$(ArtifactsBinDir)Microsoft.Net.Sdk.AnalyzerRedirecting\$(Configuration)\net472\**\*.*" DeploymentSubpath="AnalyzerRedirecting"/>
16+
<RuntimeAnalyzersContent Include="$(RuntimeAnalyzersSourceRoot)$(NetCoreRuntimeAnalyzersSubPath)\**\*.*" DeploymentSubpath="NetCoreAnalyzers"/>
17+
<RuntimeAnalyzersContent Include="$(RuntimeAnalyzersSourceRoot)$(WindowsDesktopRuntimeAnalyzersSubPath)\**\*.*" DeploymentSubpath="WindowsDesktopAnalyzers"/>
18+
<RuntimeAnalyzersContent Include="$(RuntimeAnalyzersSourceRoot)$(AspNetCoreRuntimeAnalyzersSubPath)\**\*.*" DeploymentSubpath="AspNetCoreAnalyzers"/>
19+
<RuntimeAnalyzersContent Include="$(RuntimeAnalyzersSourceRoot)$(SDKAnalyzersSubPath)\**\*.*" DeploymentSubpath="SDKAnalyzers"/>
20+
<RuntimeAnalyzersContent Include="$(RuntimeAnalyzersSourceRoot)$(WebSDKAnalyzersSubPath)\**\*.*" DeploymentSubpath="WebSDKAnalyzers"/>
21+
</ItemGroup>
22+
</Target>
23+
24+
</Project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
using Microsoft.VisualStudio.Shell;
2+
3+
namespace Microsoft.Net.Sdk.AnalyzerRedirecting;
4+
5+
[Guid("ef89a321-14da-4de4-8f71-9bf1feea15aa")]
6+
public sealed class AnalyzerRedirectingPackage : AsyncPackage;

0 commit comments

Comments
 (0)