You might want to control the dependency assets
of the package reference, and define its preferences. For readability purposes,
it is preferred to define PrivateAssets
, IncludeAssets
, and PrivateAsssets
as XML attributes, instead of XML elements.
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup Label="Analyzers">
<PackageReference Include="DotNetProjectFile.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup Label="Analyzers">
<PackageReference Include="DotNetProjectFile.Analyzers" Version="*" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
</ItemGroup>
</Project>