I'm trying to implement automatic builds in TFS for a WPF project. The automatic build works great, but I can't prepare a nuget package with the project.
Here is my build process in TFS :
If I remove NuGet pack and NuGet push, it works without trouble.
Here is the messages I get by TFS:
Found packages.config. Using packages listed as dependencies
NuGet.CommandLine.CommandLineException: Unable to find 'Extended.Wpf.Toolkit.3.3.0.nupkg'. Make sure the project has been built.
at NuGet.CommandLine.ProjectFactory.AddDependencies(Dictionary`2 packagesAndDependencies)
at NuGet.CommandLine.ProjectFactory.ProcessDependencies(PackageBuilder builder)
at NuGet.CommandLine.ProjectFactory.CreateBuilder(String basePath, NuGetVersion version, String suffix, Boolean buildIfNeeded, PackageBuilder builder)
at NuGet.Commands.PackCommandRunner.BuildFromProjectFile(String path)
at NuGet.CommandLine.PackCommand.ExecuteCommand()
at NuGet.CommandLine.Command.ExecuteCommandAsync()
at NuGet.CommandLine.Command.Execute()
at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)
Unable to find 'Extended.Wpf.Toolkit.3.3.0.nupkg'. Make sure the project has been built.
##[error]The nuget command failed with exit code(1) and error(Unable to find 'Extended.Wpf.Toolkit.3.3.0.nupkg'. Make sure the project has been built.)
In the logs, it says it doesn't find 'Extended.Wpf.Toolkit.3.3.0.nupkg'. I do use NuGet Restore before my build, and the build is correct. In the logs of TFS, I can see it uses 'Extended.Wpf.Toolkit.3.3.0'
I already tried to add -Prop Platform=AnyCPU
on the commands used by NuGet for packing but it didn't change anything. I ran the command on my computer and it worked.
Here are the pages I already checked in my search of a fix :
- https://developercommunity.visualstudio.com/content/problem/245349/the-nuget-command-failed-with-exit-code1-and-error.html
- NuGet pack for TFS Continuous Integration
- NuGet pack fails with "Unable to find '@(_OutputPathItem->'%(FullPath)..."
- VisualStudio Online and pack Nuget packages
- http://timjames.me/blog/2015/07/29/nuget-pack-fails-with-exited-with-code-1/
- https://www.benday.com/2017/05/03/walkthrough-publish-to-private-nuget-server-from-tfs2017-build/