I am trying to set up a Windows Server-based CI to compile a VS project whose dependencies are managed by vcpkg; my container manager is Docker. I am using Window Server as a base (mcr.microsoft.com/windows/servercore:10.0.17763.5576
).
I generated the container using VS Build Tool 2022, installing the compiler and adding vckpg as well; however, I am facing many difficulties preparing the container because of vcpkg.
When I try to compile the project in the host OS, everything works fine, and dependencies are correctly downloaded and linked. Conversely, when I run the vcpkg install
command in the cloned repository inside the container, I get the error: "Could not locate a complete Visual Studio instance". After the message, nothing is written, so vcpkg is not giving the list of environments it scanned.
I tried all sorts of fixes:
VCPKG_VISUAL_STUDIO_PATH
, VCPKG_ROOT
to point, respectively, to the root folder of VS 2022 and vcpkg,Up to this point, I was unable to install the required dependencies.
Has someone solved this problem?
The solution to this problem is described here and amounts at installing many optional packages.
Here is the command I employed to install the tools in the container.
vs_BuildTools install ; \
--includeRecommended --includeOptional ; \
--add Microsoft.VisualStudio.Workload.VCTools ; \
--add Microsoft.VisualStudio.Component.VC.ATLMFC ; \
--add Microsoft.VisualStudio.Workload.VisualStudioExtensionBuildTools ; \
--quiet --norestart --nocache --wait
While this will make another Visual Studio instance available, it is basically Visual Studio 14.0.
After that the container must be update to actually employ the 2022 version.