<ItemGroup>
<!-- Reference the analyzer to ensure it's built but don't reference its output -->
<ProjectReference Include="..\MyCoolLibrary\MyCoolLibrary.Analyzers.csproj" OutputItemType="AnalyzerAssemblyPath" ReferenceOutputAssembly="false" Private="true" />
</ItemGroup>
<Target Name="IncludeAnalyzerInPackage" AfterTargets="ResolveProjectReferences">
<ItemGroup>
<None Include="@(AnalyzerAssemblyPath -> '%(Identity)')" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
</ItemGroup>
</Target>
The OutputItemType attribute on the ProjectReference is specifying that the output of the ProjectReference should be captured in a new item type named AanalyzerAssemblyPath, which is then referenced in the target that's defined, but the editor says the AnalyzerAssemblyPath has no value assigned:
Consider the following in a .csproj file:
The
OutputItemType
attribute on theProjectReference
is specifying that the output of theProjectReference
should be captured in a new item type namedAanalyzerAssemblyPath
, which is then referenced in the target that's defined, but the editor says theAnalyzerAssemblyPath
has no value assigned: