Just as the question says really, how can I pack multiple projects / assemblies using dotnet pack?
Using VS2017 with new csproj files.
Include assemblies what you need in csproj file
<ItemGroup>
<Content Include="bin\Release\net46\Newtonsoft.Json.dll">
<PackagePath>lib\net46\</PackagePath>
<Pack>true</Pack>
</Content>
</ItemGroup>
also if you want to include assembly from your solution you can do this in the same way, but to exclude dependency to another nuget package use PrivateAssets tag
<ItemGroup>
<Content Include="bin\Release\net46\My.Contracts.dll">
<PackagePath>lib\net46\</PackagePath>
<Pack>true</Pack>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="My.Contracts.csproj">
<PrivateAssets>all</PrivateAssets>
</ProjectReference>
</ItemGroup>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With