From 59b94e4b9230f9bcc60959ec330b67188786e619 Mon Sep 17 00:00:00 2001 From: Pranav K <prkrishn@hotmail.com> Date: Fri, 17 Jul 2020 13:20:52 -0700 Subject: [PATCH] Ensure analyzer does not appear in build and publish outputs (#24072) Also make the analyzer actually work --- Directory.Build.props | 2 ++ eng/tools/RepoTasks/RepoTasks.csproj | 1 + .../src/Internal.AspNetCore.Analyzers.csproj | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 4b42f630ad4..d138b781a7c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -153,6 +153,8 @@ AND '$(MSBuildProjectExtension)' == '.csproj'"> <ProjectReference Include="$(RepoRoot)src\Analyzers\Internal.AspNetCore.Analyzers\src\Internal.AspNetCore.Analyzers.csproj" + ReferenceOutputAssembly="false" + OutputItemType="Analyzer" PrivateAssets="All" Version="$(InternalAspNetCoreAnalyzersPackageVersion)" IsImplicitlyDefined="true" /> diff --git a/eng/tools/RepoTasks/RepoTasks.csproj b/eng/tools/RepoTasks/RepoTasks.csproj index 9cfe1b2b2a9..e71a1d75918 100644 --- a/eng/tools/RepoTasks/RepoTasks.csproj +++ b/eng/tools/RepoTasks/RepoTasks.csproj @@ -24,6 +24,7 @@ <ItemGroup Condition="'$(TargetFramework)' == 'net472'"> <PackageReference Include="Wix" Version="3.11.1" /> + <PackageReference Include="System.Net.Http" Version="4.3.4" /> <Reference Include="Microsoft.Build" /> <Reference Include="Microsoft.Build.Framework" /> diff --git a/src/Analyzers/Internal.AspNetCore.Analyzers/src/Internal.AspNetCore.Analyzers.csproj b/src/Analyzers/Internal.AspNetCore.Analyzers/src/Internal.AspNetCore.Analyzers.csproj index f4d42dc817b..cf315eea415 100644 --- a/src/Analyzers/Internal.AspNetCore.Analyzers/src/Internal.AspNetCore.Analyzers.csproj +++ b/src/Analyzers/Internal.AspNetCore.Analyzers/src/Internal.AspNetCore.Analyzers.csproj @@ -8,7 +8,7 @@ <BuildOutputTargetFolder>analyzers/dotnet/cs/</BuildOutputTargetFolder> <!-- Except for analyzer unit tests, analyzers should not be referenced by other projects in this repo. Analyzers cannot be used as - a project reference. The SDK currently only supports using analyzers as a PackageReference. This flag prevents this project from + a project reference unless referenced with OutputItemType="Analyzer". The SDK currently only supports using analyzers as a PackageReference. This flag prevents this project from being used as a `<Reference>`, which indicates that a reference is interchangeable between ProjectRef and PackageRef. --> <IsProjectReferenceProvider>false</IsProjectReferenceProvider> -- GitLab