Installing the Visual Studio 2015 toolkit v140 on a Microsoft hosted Azure Devops Build Pipeline Agent

0 votes
I attempted to install the v140 toolset using the 2017 installer:
pool:
    vmImage: 'vs2017-win2016'

steps:
- task: PowerShell@2
  displayName: 'Install Visual Studio v140 Toolset'
  inputs:
    targetType: 'inline'
    script: |
      Write-Output "Starting the installation process. This will take some time"
      $installProcess = Start-Process -FilePath $(Build.SourcesDirectory)/External/VisualStudioBuildTools/installer.exe -ArgumentList "--add Microsoft.VisualStudio.Component.VC.140", "--quiet", "--wait", "--norestart" -Wait -PassThru
      Write-Output "Install Completed with code $($process.ExitCode)"

- task: VSBuild@1
  displayName: 'Build Debug [.sln]'
  inputs:
    solution: '$(Build.SourcesDirectory)/LegacySolution.sln'
    vsVersion: '15.0'
    configuration: 'Debug'
    platform: 'x64'

When I run this in Azure DevOps, the install process exits with code 0 (success) after about a minute. However, when it then tries to build the solution it fails with:
##[error]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platform.targets(67,5): Error MSB8020: The build tools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install v140 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution".

Has anyone tried this before and succeeded?
Mar 29 in Other DevOps Questions by Kichu
• 17,220 points
11 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Other DevOps Questions

0 votes
1 answer

Which is better azure devops or aws devops?

Hi, It depends according to your use case. ...READ MORE

answered Sep 21, 2020 in Cloud Computing by MD
• 95,340 points
1,188 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP