2

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.

Piedone
  • 2,693
  • 2
  • 24
  • 43
  • I know that `dotnet build` and Visual Studio, does things very differently. Not sure in what way. It might be that the team city .NET runner uses Visual Studio instead of `dotnet`. – Michael Sep 03 '20 at 20:37
  • Does it behave correctly if you use PowerShell and dotnet in your build script? – Michael Sep 03 '20 at 20:38
  • Yes, if we use the same command with the same parameters as a PowerShell build step then it's correct, just as it is from a PS console on the VM otherwise. The issue only surfaces if using the .NET Runner (it's a question whether we'd like to use it, I think it's necessary for nicely formatted logs but we're investigating). – Piedone Sep 04 '20 at 14:15
  • Depending on which version of Team City you use, there should be a `Runner type` named `.NET Core (dotnet). I would use that one. https://blog.jetbrains.com/teamcity/2016/11/teamcity-dotnet-core/ – Michael Sep 04 '20 at 22:33
  • Hmm, I'm not sure how this plugin is different (the ".NET" one uses the same dotnet.exe commands) but thanks for the tip, we'll check it out. – Piedone Sep 05 '20 at 19:20
  • We're actually using the new version of this (in the current TC version it's just called ".NET"). – Piedone Sep 05 '20 at 19:58

1 Answers1

1

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).

Piedone
  • 2,693
  • 2
  • 24
  • 43