Skip to content

Commit 92c216f

Browse files
authored
fix: exclude native gRPC assemblies from package content (#33)
Native gRPC assemblies (grpc_csharp_ext.*.dll, libgrpc_csharp_ext.*) were being packaged as contentFiles, causing them to appear as linked items in Solution Explorer when consuming the package. These files are still needed at runtime but should flow through transitively from the Grpc.Core dependency rather than being bundled in this package.
1 parent 2a746a0 commit 92c216f

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/CodingWithCalvin.Otel4Vsix/CodingWithCalvin.Otel4Vsix.csproj

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,19 @@
3434
<ItemGroup>
3535
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
3636
<None Include="..\..\assets\icon.png" Pack="true" PackagePath="\" Condition="Exists('..\..\assets\icon.png')" />
37-
<None Include="build\CodingWithCalvin.Otel4Vsix.targets" Pack="true" PackagePath="build\" />
3837
</ItemGroup>
3938

39+
<!-- Exclude native gRPC assemblies from being packed as content files.
40+
These will still be provided transitively via Grpc.Core dependency. -->
41+
<Target Name="ExcludeGrpcNativeFromPack" BeforeTargets="GenerateNuspec;_GetPackageFiles">
42+
<ItemGroup>
43+
<Content Remove="@(Content)" Condition="$([System.String]::new('%(Identity)').EndsWith('grpc_csharp_ext.x64.dll'))" />
44+
<Content Remove="@(Content)" Condition="$([System.String]::new('%(Identity)').EndsWith('grpc_csharp_ext.x86.dll'))" />
45+
<Content Remove="@(Content)" Condition="$([System.String]::new('%(Identity)').EndsWith('libgrpc_csharp_ext.x64.dylib'))" />
46+
<Content Remove="@(Content)" Condition="$([System.String]::new('%(Identity)').EndsWith('libgrpc_csharp_ext.x64.so'))" />
47+
</ItemGroup>
48+
</Target>
49+
4050
<ItemGroup>
4151
<PackageReference Include="OpenTelemetry" Version="1.10.0" />
4252
<PackageReference Include="OpenTelemetry.Api" Version="1.10.0" />

0 commit comments

Comments
 (0)