question

74527816 avatar image
0 Votes"
74527816 asked TianyuSun-MSFT commented

Visual Studio Build tools 2022 did not follow the correct Build Hierarchy

I have a solution with multiple projects. The solution can be build correctly in the Visual studio 2022 Profesional IDE.

I want to build this solution on a (Jenkins) buildserver. On the buildserver I installed the Visual Studio Build tools 2022. When I build the project it directly starts with the main project before building the other projects first.

When I build the project from the command prompt on the machine with the IDE installed it builds correctly.

When I turned on the compiler option /v:diag it outputs the the builld Hierarchy will be reported.

Here are the 2 parts of the log: It shows that the build tools don't use the build dependencies. How to deal with this?

Buildtools VS2022:
============================== Build Hierarchy (IDs represent configurations) =====================================================
Id : Exclusive Time Total Time Path (Targets)
----------------------------------------------------------------------------------------------------------------------------------- (TaskId:0)
0 : 0.056s 4.330s C:\Jenkins\workspace\Test2\TestRunner.sln () (TaskId:0)
| 1 : 3.868s 3.926s C:\Jenkins\workspace\Test2\TestRunner.Gui.Views\TestRunner.Gui.Views.csproj () (TaskId:0)
| . 9 : 0.058s 0.058s C:\Jenkins\workspace\Test2\TestRunner.Gui\TestRunner.Gui.fsproj (GetTargetFrameworks) (TaskId:0)
| 2 : 0.002s 0.002s C:\Jenkins\workspace\Test2\TestRunner.Gui\TestRunner.Gui.fsproj () (TaskId:0)
| 3 : 0.059s 0.059s C:\Jenkins\workspace\Test2\TestRunner.Common\TestRunner.Common.fsproj () (TaskId:0)
| 4 : 0.064s 0.064s C:\Jenkins\workspace\Test2\TestRunner.Application\TestRunner.Application.fsproj () (TaskId:0)
| 5 : 0.065s 0.065s C:\Jenkins\workspace\Test2\TestRunner.Application.Test\TestRunner.Application.Test.fsproj () (TaskId:0)
| 6 : 0.054s 0.054s C:\Jenkins\workspace\Test2\TestRunner.Core.Test\TestRunner.Core.Test.fsproj () (TaskId:0)
| 7 : 0.047s 0.047s C:\Jenkins\workspace\Test2\TestRunner.Instruments\TestRunner.Instruments.fsproj () (TaskId:0)
. 8 : 0.056s 0.056s C:\Jenkins\workspace\Test2\TestRunner.Logger\TestRunner.Logger.fsproj () (TaskId:0)

VS2022 ide version from command prompt
============================== Build Hierarchy (IDs represent configurations) =====================================================
Id : Exclusive Time Total Time Path (Targets)
----------------------------------------------------------------------------------------------------------------------------------- (TaskId:0)
0 : 0.038s 13.016s D:\USERDATA\Instr-Salland-TestRunner\testRunner.sln () (TaskId:0)
| 8 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Logger\TestRunner.Logger.fsproj () (TaskId:0)
| 7 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Instruments\TestRunner.Instruments.fsproj () (TaskId:0)
| 4 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Application\TestRunner.Application.fsproj () (TaskId:0)
| 3 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Common\TestRunner.Common.fsproj () (TaskId:0)
| 2 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Gui\TestRunner.Gui.fsproj () (TaskId:0)
| 1 : 1.611s 4.491s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Gui.Views\TestRunner.Gui.Views.csproj () (TaskId:0)
| | 8 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Logger\TestRunner.Logger.fsproj () (TaskId:0)
| | 7 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Instruments\TestRunner.Instruments.fsproj () (TaskId:0)
| | 15 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Core\TestRunner.Core.fsproj () (TaskId:0)
| | 3 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Common\TestRunner.Common.fsproj () (TaskId:0)
| | 4 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Application\TestRunner.Application.fsproj () (TaskId:0)
| | 9 : 0.080s 0.080s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Gui\TestRunner.Gui.fsproj (GetTargetFrameworks) (TaskId:0)
| | 10 : 0.100s 0.100s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Application\TestRunner.Application.fsproj (GetTargetFrameworks) (TaskId:0)
| | 11 : 0.070s 0.070s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Common\TestRunner.Common.fsproj (GetTargetFrameworks) (TaskId:0)
| | 12 : 0.060s 0.060s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Core\TestRunner.Core.fsproj (GetTargetFrameworks) (TaskId:0)
| | 13 : 0.080s 0.080s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Instruments\TestRunner.Instruments.fsproj (GetTargetFrameworks) (TaskId:0)
| | 14 : 0.059s 0.059s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Logger\TestRunner.Logger.fsproj (GetTargetFrameworks) (TaskId:0)
| | 2 : 0.600s 2.430s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Gui\TestRunner.Gui.fsproj () (TaskId:0)
| | | 8 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Logger\TestRunner.Logger.fsproj () (TaskId:0)
| | | 7 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Instruments\TestRunner.Instruments.fsproj () (TaskId:0)
| | | 15 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Core\TestRunner.Core.fsproj () (TaskId:0)
| | | 3 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Common\TestRunner.Common.fsproj () (TaskId:0)
| | | 4 : 0.510s 1.830s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Application\TestRunner.Application.fsproj () (TaskId:0)
| | | | 8 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Logger\TestRunner.Logger.fsproj () (TaskId:0)
| | | | 3 : 0.400s 0.400s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Common\TestRunner.Common.fsproj () (TaskId:0)
| | | | 15 : 0.310s 0.610s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Core\TestRunner.Core.fsproj () (TaskId:0)
| | | | | 8 : 0.300s 0.300s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Logger\TestRunner.Logger.fsproj () (TaskId:0)
| | | | . 16 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Logger\TestRunner.Logger.fsproj (GetNativeManifest) (TaskId:0)
| | | | 7 : 0.300s 0.300s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Instruments\TestRunner.Instruments.fsproj () (TaskId:0)
| | | | 19 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Instruments\TestRunner.Instruments.fsproj (GetNativeManifest) (TaskId:0)
| | | | 18 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Core\TestRunner.Core.fsproj (GetNativeManifest) (TaskId:0)
| | | . 17 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Common\TestRunner.Common.fsproj (GetNativeManifest) (TaskId:0)
| | . 20 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Application\TestRunner.Application.fsproj (GetNativeManifest) (TaskId:0)
| . 21 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Gui\TestRunner.Gui.fsproj (GetNativeManifest) (TaskId:0)
| 5 : 0.679s 0.690s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Application.Test\TestRunner.Application.Test.fsproj () (TaskId:0)
| | 22 : 0.005s 0.005s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Application\TestRunner.Application.fsproj (InitializeSourceRootMappedPaths) (TaskId:0)
| | 23 : 0.002s 0.002s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Common\TestRunner.Common.fsproj (InitializeSourceRootMappedPaths) (TaskId:0)
| | 24 : 0.001s 0.001s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Core\TestRunner.Core.fsproj (InitializeSourceRootMappedPaths) (TaskId:0)
| | 25 : 0.001s 0.001s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Instruments\TestRunner.Instruments.fsproj (InitializeSourceRootMappedPaths) (TaskId:0)
| . 26 : 0.002s 0.002s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Logger\TestRunner.Logger.fsproj (InitializeSourceRootMappedPaths) (TaskId:0)
| 6 : 0.550s 0.550s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Core.Test\TestRunner.Core.Test.fsproj () (TaskId:0)
| 28 : 0.011s 2.561s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Installer\TestRunner.Installer.csproj.metaproj () (TaskId:0)
| . 29 : 2.550s 2.550s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Installer\TestRunner.Installer.csproj () (TaskId:0)
| | . 30 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Gui.Views\TestRunner.Gui.Views.csproj (GetNativeManifest) (TaskId:0)
. 27 : 0.000s 0.000s D:\USERDATA\Instr-Salland-TestRunner\TestRunner.Core\TestRunner.Core.fsproj.metaproj () (TaskId:0)



dotnet-csharpvs-msbuilddotnet-fsharp
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @74527816 , welcome to Microsoft Q&A forum. Did you use the same command line arguments to build the solution? Did you use the same version of VS(IDE and Build Tools) to build your project? Besides, did the build succeed when you used Build Tools?

0 Votes 0 ·

Hi @TianyuSun-MSFT,

For both situations I used: MSBuild.exe /p:Configuration=Release /property:Platform=x64 /v:diag testRunner.sln

In the ide this version is used: (on my laptop)
Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

17.1.0.7609

On the buildserver: (With the buildtools)
Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

17.1.0.7609

So it's exactly the same version.

On my laptop, with the IDE, the build succeed.
On the buildserver, with the buildtools, it fails. Because it's building TestRunner.Gui.Views.csproj and it complains about missing stuff from the other projects.

0 Votes 0 ·

Hi @74527816 ,

Thanks for sharing the detailed information.

Are all needed references, files and components included in the solution folder on your build server? And is it possible for you to install VS Build Tools locally and test if your solution built well by using VS Build Tools locally?

0 Votes 0 ·

0 Answers