Dotnet build behaves differently when executed from TeamCity

705 views Asked by At

We're seeing a Lucene.NET analyzer build warning that shouldn't be there when executing dotnet build for one of our ASP.NET Core 3.1 web apps. The strange thing is that this warning seems to happen only when executed with the .NET runner in TeamCity; it (correctly) doesn't happen when running the dotnet build command directly from a PowerShell runner, or from the PowerShell console on the same machine (with the same user account, same folder, same code).

The build warning is actually due to a bug (that was fixed in a later Lucene.NET version) but the point is that we see different behavior.

We have tried running the exact same command that's displayed in the Build Log, including passing the TeamCity-generated RSP file to it. Still, outside of the .NET runner we can't reproduce the warning. We confirmed that the same user account runs the process, uses the same NuGet cache and dotnet.exe (and .NET SDK), runs in the same folder for the same code, with the same parameters.

The only thing we can think of is that somehow the .NET Plugin executes dotnet build differently but in a way that's invisible from the Build Log. However, we are out of ideas what else to try or investigate.

Could you help pinpoint where the difference in the two builds could be? Thank you in advance!

I've previously asked this on the TeamCity forum but didn't get a reply.

1

There are 1 answers

0
Piedone On

We ended up just running dotnet build directly, not using the .NET Runner. It has also cut certain builds' times down drastically (40-50% where there were a lot of build warnings).