teamcity.net-coredotnet-restore

TeamCity NetCore 'dotnet restore' Error Value cannot be null


I'm attempting to build and deploy a netcore app for the first time with TeamCity. I followed the guide from https://blog.jetbrains.com/teamcity/2016/11/teamcity-dotnet-core/

I'm running into an issue where TeamCity returns a 'Exit code 1." error at the beginning of the first build step. (a dotnet restore) step.

In the build logs it says the following.

Step 1/3: .NET Core (dotnet)
[15:33:58][Step 1/3] Starting: "C:\Program Files\dotnet\dotnet.exe" restore src/ProjectFolder
[15:33:58][Step 1/3] in directory:  E:\TeamCity\buildAgent3\work\1151efaecddc7512
[15:33:58][Step 1/3] error: Value cannot be null.
[15:33:58][Step 1/3] error: Parameter name: path1
[15:33:58][Step 1/3] Process exited with code 1
[15:33:58][Step 1/3] Step .NET Core (dotnet) failed

I have tried reinstalling the NetCore sdk on my build agents. Among other things. Any guidance or help would be appreciated.

Current dotnet version is 1.0.0-preview2-1-003177.


Solution

  • I fixed this by going to the build configuration and added a parameter env.HOMEwith value /home/core(user home directory) then the dotnet restore worked.

    Sure, it's an ugly workaround just to get by.