Преглед на файлове

Ensure analyzer does not appear in build and publish outputs (#24072)

Also make the analyzer actually work
Pranav K преди 5 години
родител
ревизия
59b94e4b92

+ 2 - 0
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" />

+ 1 - 0
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" />

+ 1 - 1
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>