Install Visual Studio 2019 build tools

Vadim Malyshev 1 Reputation point
2022-01-24T05:40:13.76+00:00

Hello!

I am trying to install the Visual Studio 2019 build tool in my docker container with the following dockerfile:

RUN curl -SL --output winsdksetup.exe https://go.microsoft.com/fwlink/?linkid=2120843
RUN winsdksetup.exe /quiet
RUN curl -SL --output vs_buildtools.exe https://download.visualstudio.microsoft.com/download/pr/378e5eb4-c1d7-4c05-8f5f-55678a94e7f4/b9619acc0f9a1dfbdc1b67fddf9972e169916ceae237cf95f286c9e5547f804f/vs_BuildTools.exe
 && (start /w vs_buildtools.exe --quiet --wait --norestart --nocache modify
 --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\BuildTools"
 --add Microsoft.Net.ComponentGroup.4.6.2.DeveloperTools
 --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64
 || IF "%ERRORLEVEL%"=="3010" EXIT 0)
 && MsiExec.exe /i https://nodejs.org/dist/v14.9.0/node-v14.9.0-x64.msi /qn
 && del /q vs_buildtools.exe
ENTRYPOINT ["cmd", "/c", "dir", "C:\\Program Files (x86)\\Microsoft Visual Studio"]

but this installs Visual Studio 2022. How can I force VS 2019 to be installed and not 2022?

I tried downloading from the URL https://aka.ms/vs/16/release/vs_buildtools.exe - it doesn't work too.

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
783 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vadim Malyshev 1 Reputation point
    2022-01-24T06:46:03.277+00:00

    I found the problem. I used wrong OS image (it contains VS 2022).

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.