posted on July 08, 2018 15:55
My .Net Core Hello World application built and ran fine on my dev machine under VS2017, and also using MsBuild from the command prompt.
On my Build Server it repeatedly failed claiming it could not find the log4net package (OK it is slightly more than "Hello World").
I fixed it by changing the Account that the Build Agent runs under. It was the default System account and I changed to a user account. I can't really be certain, but I think that the issue is caused by the System account not being able to restore packages to C:\Users\[System account]\.nuget\packages.
So whilst I didn't fully track down the problem, I have a working solution.
I'll justify it partly by saying that I prefer the build to run under a known account within my control rather than the somewhat nebulous System account.