Reputation: 4445
As you can see below, I am able to pack the .csproj file from the command line on my machine.
But when I try to do it in Azure Devops with this configuration:
My build fails to pack the project.
None of my searching has provided information about what in my project is dependent on System.ValueTuple.4.4.0.nupkg.
For completeness, here is the project in solution explorer of VS 2017.
Upvotes: 2
Views: 1977
Reputation: 4445
The NuGet Pack task was having issues packing projects because I didn't explicitly set the value of the $(BuildConfiguration)
variable on my pipeline.
The secondary issue with the task not bringing in dependencies correctly is a known issue with nuget.exe
which was mitigated by using the MSBuild task with the /t:Pack
option.
My pipeline task for building now looks like this:
Make sure to take note of the parameters given to MSBuild for targeting Pack
.
For .Net Framework, also take note of the Powershell task adding package references to the NuGet.Build.Tasks.Pack package, which adds Pack as a target for MSBuild. I added this powershell task to the build so that devs don't need to add the package explicitly to new projects in this solution.
Upvotes: 1