Skip to content

Commit 35f46fb

Browse files
Rafal Maciagclaude
andcommitted
Fix NuGet package to include native libraries
- Added runtimes/** with all native libraries (libnng.so, nng.dll) to package - Added build/nng.NET.targets to package for automatic native library deployment - Set version to 1.0.2 for both Nng and Nng.Shared packages - Fixed missing native libraries issue causing DllNotFoundException 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 71c0f49 commit 35f46fb

File tree

2 files changed

+11
-18
lines changed

2 files changed

+11
-18
lines changed

nng.NET.Shared/nng.NET.Shared.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
<PropertyGroup>
1212
<PackageId>ModelingEvolution.Nng.Shared</PackageId>
13+
<VersionPrefix>1.0.2</VersionPrefix>
1314
<PackageOutputPath>../bin/$(Configuration)</PackageOutputPath>
1415
</PropertyGroup>
1516

nng.NET/nng.NET.csproj

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
<DebugType>full</DebugType>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
88
<PackageId>ModelingEvolution.Nng</PackageId>
9+
<VersionPrefix>1.0.2</VersionPrefix>
910
<!-- Needed to avoid `error NU5128` when running `dotnet pack`.
10-
Assemblies for targetted frameworks are in runtimes/ instead of lib/ or ref/
11+
Assemblies for targetted frameworks are in runtimes/ instead of lib/ or ref/
1112
See: https://docs.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu5128#scenario-2
1213
-->
1314
<TargetFrameworks>net9.0;net10.0</TargetFrameworks>
@@ -19,25 +20,16 @@
1920
</ProjectReference>
2021
</ItemGroup>
2122

23+
<!-- Include native libraries in NuGet package -->
2224
<ItemGroup>
23-
<None Update="runtimes\linux-arm64\native\libnng.so">
24-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
25+
<None Include="runtimes\**\*.*">
26+
<Pack>true</Pack>
27+
<PackagePath>runtimes\%(RecursiveDir)%(Filename)%(Extension)</PackagePath>
28+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2529
</None>
26-
<None Update="runtimes\linux-x64\native\libnng.so">
27-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
28-
</None>
29-
<None Update="runtimes\win-x64\native\nng.dll">
30-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
30+
<None Include="build\nng.NET.targets">
31+
<Pack>true</Pack>
32+
<PackagePath>build\$(PackageId).targets</PackagePath>
3133
</None>
3234
</ItemGroup>
33-
34-
<!-- Must be run after build so output assembly is in runtimes/ -->
35-
<Target Name="Runtimes" AfterTargets="Build">
36-
<ItemGroup>
37-
<Content Include="runtimes\**">
38-
<PackagePath>runtimes</PackagePath>
39-
<Visible>false</Visible>
40-
</Content>
41-
</ItemGroup>
42-
</Target>
4335
</Project>

0 commit comments

Comments
 (0)