When using the TeamCity built-in .Net runners we are getting a strange error about publishing the GitHub Packages.
- The runner can be the .Net Restore, or one of the other .Net runners that implicitly calls "restore" like "publish"
- If we run the command manually on the server we do not get the warnings.
- When we run the .Net runner with restore we get hundreds of warnings as follows:
"C:\Program Files\dotnet\sdk\3.1.402\NuGet.targets(128,5): error : Please use the --api-key and --source options when publishing to GitHub Packages"
We are receiving this error and cannot see why.
We previously had a GitHub nuget source added on the machine, but we have now removed this and cleared caches (AFAIK). Requesting the source list from nuget on the command line shows that the GitHub source is not present.
We believe it is a TeamCity issue because when we run the same commands as the same user on the same machine we do not receive these warnings.
The step(s) causing this issue are "dotnet restore" and "dotnet publish" steps that should not even care about publishing to GitHub packages and so shouldn't show this warning.
We have a "dotnet nuget push" step further down that we use that is working as expected.
We also have been using /warnaserror on our "publish" step which causes the build to error and fail, but removing this flag is also not ideal.
This problem seems to have appeared in the last couple of days. I cannot determine when I last updated TeamCity so I am not sure if it coincides with this issue.