Skip to content

Exclude assembly that is added by consumed package targets #122

@quasarea

Description

@quasarea

Discussed in #120

Originally posted by quasarea June 29, 2021
Hi,

I have library that depends on Grpc.Core package. This package has a targets file that adds assemblies to output

...
  <ItemGroup Condition="'$(Grpc_SkipNativeLibsCopy)' != 'true'">
    <Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win-x86\native\grpc_csharp_ext.x86.dll">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <Link>grpc_csharp_ext.x86.dll</Link>
      <Visible>false</Visible>
    </Content>
...

How can I exclude grpc_csharp_ext.x86.dll from being packaged? I have tried several combinations of

    <PackInference Update="Content" PackExclude="**/grpc_csharp_ext.x86.dll;**/grpc_csharp_ext.x64.dll" />
    <PackInference Update="Content" PackExclude="$(OutputPath)/**/grpc_csharp_ext.x64.dll" />
    <PackInference Update="Content" PackExclude="$(OutputPath)/grpc_csharp_ext.x64.dll" />
    <PackInference Update="Content" PackExclude="**/grpc_csharp_ext.x64.dll" />

But nothing worked :(

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions