I want to use "dotnet pack" to produce a nuget package, but I don't want to include the assembly file. My project doesn't have code, yet calling "dotnet pack" creates a package with an empty assembly in it.
How can I do this using csproj and dotnet.exe?
You have two options:
<IncludeBuildOutput>false</IncludeBuildOutput>
(add to a PropertyGroup section). This instructs the "Pack" target not to add the assembly to the package. See https://learn.microsoft.com/en-us/nuget/schema/msbuild-targets for more details.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