TeamCity - Building dotnet core web api project using cake script
Asked Answered
W

2

7

Running Cake Build script on my local machine works fine but when same script is run on TeamCity, the following error appears: Nuspec file does not exist in package.

enter image description here

Any idea what could have caused this error?

Wojak answered 13/3, 2018 at 5:56 Comment(6)
go to the packages folder on your hard drive and delete all its contents. After that restore packagesLineup
@SeniorPomidor I tried this but I am still getting this error. When I build the project from the TeamCity/Works directory using the build.cake file, it build successfully.Wojak
then just build from this directory.Lineup
@SeniorPomidor I want TeamCity to trigger the build automatically rather than running it manually.Wojak
I want to say just set the working directory as TeamCity/Works. and buildLineup
I had a similar problem with TFS 2017. Build was always red with same message, but when I tried in a console, it worked. Turns out that the reason why it worked was my user: When I started the console with the same user the build uses, I got the same error. So I deleted everything in <builduser home>/.nuget/packages/*, after that the build worked again.Kv
B
14

I spent two days due to this error On dotnet build --configuration Release in TeamCity PowerShell, always got this error

error NU5000: Nuspec file does not exist in package

After deleting this folder, everything worked C:/Users/teamcity_user/.nuget

Berte answered 20/5, 2018 at 11:45 Comment(1)
Thanks for saving me 2 days ;)Thun
M
3

I add an additional step on top of my build steps which is a command line custom script

dotnet nuget locals --clear all

Build Step to clear nuget locals

Milkman answered 5/12, 2018 at 11:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.