# .NET .csproj scan -- exclude privateAssets

**URL:** <https://community.sonatype.com/t/net-csproj-scan-exclude-privateassets/7013>\
**Category:** Sonatype Lifecycle & Firewall\
**Created:** [July 27, 2021, 8:28pm UTC](https://community.sonatype.com/t/net-csproj-scan-exclude-privateassets/7013 "2021-07-27T20:28:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris.boley](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@chris.boley](https://community.sonatype.com/u/chris.boley)\
**Post date:** [July 27, 2021, 8:28pm UTC](https://community.sonatype.com/t/net-csproj-scan-exclude-privateassets/7013/1 "2021-07-27T20:28:40Z")

</div>

Hello,

I’m wondering if it’s possible to exclude packages marked as privateAssets in a .csproj file. Here is a sample .csproj.

```auto
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <LangVersion>preview</LangVersion>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
  </PropertyGroup>
  <ItemGroup>
    <FrameworkReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.2">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.9" />
    <PackageReference Include="SecurityCodeScan.VS2019" Version="5.0.0">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.333">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
  </ItemGroup>
  <ItemGroup>
    <AdditionalFiles Include="../../../build/stylecop.json" Link="stylecop.json" />
  </ItemGroup>
</Project>

```

The packages marked with “PrivateAssets” property should be excluded from scanning as they are not included in the final package. Is there any way to exclude these?

Thanks!
