Azure DevOps Chocolatey question : install vs2022
-
(I'm not sure there's a better place to ask) I'm trying to use VS2022 in our build pipeline. I have a pipeline like this :
Quote:
pool: vmImage: 'windows-latest' variables: solution: 'MySolution.sln' steps: - task: CmdLine@2 displayName: 'Choco install additional packages' inputs: script: | choco install windows-sdk-8.1 visualstudio2017community microsoft-build-tools-2013 visualstudio2022professional - task: VSBuild@1 displayName: 'Build Debug143|x64' inputs: vsVersion: '17.0' solution: '$(solution)' maximumCpuCount: true msbuildArchitecture: 'x64' platform: 'x64' configuration: 'Debug143'
I get errors that it cannot find the installation.
Quote:
2022-02-17T18:46:30.0197396Z ##[error]MyProject.vcxproj(77,3): Error MSB4019: The imported project "C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.Cpp.Default.props" was not found. Confirm that the expression in the Import declaration "C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\\Microsoft.Cpp.Default.props" is correct, and that the file exists on disk.
When I put a "dir /s" in my pipeline, it looks like VS2022 is not installed in that path. I'm not sure what I have to do to make it work. Any Idea ? Thanks.
CI/CD = Continuous Impediment/Continuous Despair
-
(I'm not sure there's a better place to ask) I'm trying to use VS2022 in our build pipeline. I have a pipeline like this :
Quote:
pool: vmImage: 'windows-latest' variables: solution: 'MySolution.sln' steps: - task: CmdLine@2 displayName: 'Choco install additional packages' inputs: script: | choco install windows-sdk-8.1 visualstudio2017community microsoft-build-tools-2013 visualstudio2022professional - task: VSBuild@1 displayName: 'Build Debug143|x64' inputs: vsVersion: '17.0' solution: '$(solution)' maximumCpuCount: true msbuildArchitecture: 'x64' platform: 'x64' configuration: 'Debug143'
I get errors that it cannot find the installation.
Quote:
2022-02-17T18:46:30.0197396Z ##[error]MyProject.vcxproj(77,3): Error MSB4019: The imported project "C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.Cpp.Default.props" was not found. Confirm that the expression in the Import declaration "C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\\Microsoft.Cpp.Default.props" is correct, and that the file exists on disk.
When I put a "dir /s" in my pipeline, it looks like VS2022 is not installed in that path. I'm not sure what I have to do to make it work. Any Idea ? Thanks.
CI/CD = Continuous Impediment/Continuous Despair
Not sure if it applies to you but this is the magic incantation I use find latest VS installation:
@echo off
rem
rem Setup environment for MSBuild 2017 and later
remif not "%VSCMD_VER%"=="" (
echo MSBuild environment is already set
goto :EOF
)
rem VS2017U2 contains vswhere.exe
if "%VSWHERE%"=="" set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (
set VSInstallDir=%%i
)
rem echo Visual studio installation folder is: %VSInstallDir%
rem "%VSInstallDir%\common7\tools\vsdevcmd.bat"
"%VSInstallDir%\common7\tools\vsmsbuildcmd.bat"Mircea
-
Not sure if it applies to you but this is the magic incantation I use find latest VS installation:
@echo off
rem
rem Setup environment for MSBuild 2017 and later
remif not "%VSCMD_VER%"=="" (
echo MSBuild environment is already set
goto :EOF
)
rem VS2017U2 contains vswhere.exe
if "%VSWHERE%"=="" set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (
set VSInstallDir=%%i
)
rem echo Visual studio installation folder is: %VSInstallDir%
rem "%VSInstallDir%\common7\tools\vsdevcmd.bat"
"%VSInstallDir%\common7\tools\vsmsbuildcmd.bat"Mircea
Thanks I will look at it. :thumbsup:
CI/CD = Continuous Impediment/Continuous Despair
-
(I'm not sure there's a better place to ask) I'm trying to use VS2022 in our build pipeline. I have a pipeline like this :
Quote:
pool: vmImage: 'windows-latest' variables: solution: 'MySolution.sln' steps: - task: CmdLine@2 displayName: 'Choco install additional packages' inputs: script: | choco install windows-sdk-8.1 visualstudio2017community microsoft-build-tools-2013 visualstudio2022professional - task: VSBuild@1 displayName: 'Build Debug143|x64' inputs: vsVersion: '17.0' solution: '$(solution)' maximumCpuCount: true msbuildArchitecture: 'x64' platform: 'x64' configuration: 'Debug143'
I get errors that it cannot find the installation.
Quote:
2022-02-17T18:46:30.0197396Z ##[error]MyProject.vcxproj(77,3): Error MSB4019: The imported project "C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.Cpp.Default.props" was not found. Confirm that the expression in the Import declaration "C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\\Microsoft.Cpp.Default.props" is correct, and that the file exists on disk.
When I put a "dir /s" in my pipeline, it looks like VS2022 is not installed in that path. I'm not sure what I have to do to make it work. Any Idea ? Thanks.
CI/CD = Continuous Impediment/Continuous Despair
Maximilien wrote: I'm not sure there's a better place to ask) I'm trying to use VS2022 in our build pipeline. I have a pipeline like this [$amc stocktwits ](https://codeprozone.com/code/html/149512/stocktwits-amc.html) : Quote: pool: vmImage: 'windows-latest' variables: solution: 'MySolution.sln' steps: task: CmdLine@2 displayName: 'Choco install additional packages' inputs: script: | choco install windows-sdk-8.1 visualstudio2017community microsoft-build-tools-2013 visualstudio2022professional task: VSBuild@1 displayName: 'Build Debug143|x64' inputs: vsVersion: '17.0' solution: '$(solution)' maximumCpuCount: true msbuildArchitecture: 'x64' platform: 'x64' configuration: 'Debug143' I get errors that it cannot find the installation. Quote: 2022-02-17T18:46:30.0197396Z ##[error]MyProject.vcxproj(77,3): Error MSB4019: The imported project "C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.Cpp.Default.props" was not found. Confirm that the expression in the Import declaration "C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.Cpp.Default.props" is correct, and that the file exists on disk. When I put a "dir /s" in my pipeline, it looks like VS2022 is not installed in that path. I'm not sure what I have to do to make it work. Any Idea ? Thanks. This give some error during the installation.
-
Thanks I will look at it. :thumbsup:
CI/CD = Continuous Impediment/Continuous Despair
I just noticed the bad formatting. Sorry, it's from CP not me. I tried editing my post but in the edit box the text shows OK. Not sure what's going on but smells like a bug.
Mircea