You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ci] Show VS & MSBuild install locations on Windows (#4833)
Context: https://github.com/xamarin/yaml-templates/blob/cf440bcf4daf0305be17280bf27854480314db77/environment/win/vs-msbuild.v1.yml
Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=3795214&view=logs&j=cac0e8d3-0ef5-5d2b-b57e-e8fde7204df3&t=b0ec5c6c-f5a1-5ebf-2068-57a5c78a6a85
There have been a few issues involving Xamarin.Android builds on
Windows involving problems with the Visual Studio installation or an
incorrect (older) version of MSBuild being invoked:
##[debug]Entering Invoke-VstsTool.
##[debug] FileName: 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe'
##[debug] Arguments: '"C:\A\vs2019xam000013-1\_work\2\s\Xamarin.Android.sln" … /t:Prepare /p:AutoProvision=true /bl:C:\A\vs2019xam000013-1\_work\2\s\bin\BuildRelease\msbuild-prepare.binlog …
##[debug] RequireExitCodeZero: 'True'
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" …
MSBUILD : error MSB1001: Unknown switch.
Switch: /bl:C:\A\vs2019xam000013-1\_work\2\s\bin\BuildRelease\msbuild-prepare.binlog
For switch syntax, type "MSBuild /help"
##[debug]Exit code: 1
We're not entirely sure why this happens.
Add a template include to `environment/win/vs-msbuild.v1.yml@yaml`,
which adds two new steps to **Windows** > **Build and Smoke Test**:
* `Env: Create Write-MSBuildPath.ps1`, which creates a
PowerShell script
* `Env: Visual Studio (Windows)`, which invokes the
`Write-MSBuildPath.ps1` script, printing out information about
the currently installed Visual Studio instances.
The new steps provide visibility into the Visual Studio and MSBuild
installations, utilizing `vswhere` as a means to enumerate and obtain
the Visual Studio installs on the agent. Additionally, the template
being called leverages code from the MSBuild task to locate the version
of MSBuild that will be used:
Visual Studio installations based on the vswhere.exe command
…
[
{
…
"installationPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise",
…
Visual Studio installed products:
Microsoft.VisualStudio.Product.Enterprise 16.6.30114.105: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise
IsComplete: True
IsLaunchable: True
IsRebootRequired: False
MSBuild: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe
Copy file name to clipboardExpand all lines: build-tools/automation/azure-pipelines.yaml
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -271,6 +271,8 @@ stages:
271
271
displayName: downgrade XA to stable
272
272
ignoreLASTEXITCODE: true
273
273
274
+
- template: environment/win/vs-msbuild.v1.yml@yaml # Display (in log) VS installation(s) including installation status with associated MSBuild location(s)
Copy file name to clipboardExpand all lines: build-tools/automation/yaml-templates/run-msbuild-win-tests.yaml
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,8 @@ jobs:
17
17
18
18
- template: clean.yaml
19
19
20
+
- template: environment/win/vs-msbuild.v1.yml@yaml # Display (in log) VS installation(s) including installation status with associated MSBuild location(s)
0 commit comments