Build failure as nupkg file already exists.

##[error]RedGate.Versioning.Automation.Shared.Errors.TerminatingException: The file already exists and can't be overwritten: 'C:\VSTS\BuildAgent\vsts-agent-win-x64-2.140.0\_work\1\s\POC_SSC.1.0.nupkg'
After cancelling a build half way through a build process I get the above error.  If I delete the file and try again the build works however subsequent builds fail again.  I cant keep deleting the file.
I am using the Redgate SQL Change Automation: Build in a Azure DevOps pipeline.
Any idea?

Best Answer

  • chris_godfreechris_godfree Posts: 50 Silver 1
    In the build task, have you ticked the box "Append BuildId to the NuGet package version"? That gives us a new nupkg for each build and we then reference a particular nupkg in our releases by appending "$(BUILD.BUILDID).nupkg" to the Database Package field.
Sign In or Register to comment.