Reputation: 26773
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?
Upvotes: 15
Views: 9334
Reputation: 26773
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.Upvotes: 23