我在解决方案级别的Package.props文件中具有以下条目:
<ItemGroup Label="My Label" Condition=" '$(SHFBSchemaVersion)' == '' ">
<PackageReference Include="StyleCop.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
我应该如何编辑它,以便在某些项目中排除StyleCop的引用?像这样:
<ItemGroup Label="My Label" Condition=" '$(SHFBSchemaVersion)' == '' " Exclude="MyAwsomeProject">
所以我希望'MyAwsomeProject'没有对StyleCop的引用。
答案 0 :(得分:0)
我设法使它像这样工作:
<ItemGroup Label="My Label" Condition=" '$(SHFBSchemaVersion)' == '' And '$(AssemblyName)' != 'MyAwsomeProject'">
<PackageReference Include="StyleCop.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>