I have analyzers project in my solution.
I also use Directory.Build.props
file.
I'd like to reference analyzer project by all projects (except analyzer and its tests).
What condition can I use for it? It is possible to get referencing project
?
Thanks to stijn comment, I found the solution:
<ItemGroup>
<ProjectReference
Include="..\Analyzers\GlobalAnalyzers\GlobalAnalyzers.csproj"
Condition="!$(MSBuildProjectDirectoryNoRoot.Contains('Analyzers/'))">
<PrivateAssets>all</PrivateAssets>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<OutputItemType>Analyzer</OutputItemType>
</ProjectReference>
</ItemGroup>