Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Azure DevOps Chocolatey question : install vs2022

Azure DevOps Chocolatey question : install vs2022

Scheduled Pinned Locked Moved C / C++ / MFC
visual-studiodevopstoolsquestioncsharp
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Maximilien
    wrote on last edited by
    #1

    (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

    Mircea NeacsuM M 2 Replies Last reply
    0
    • M Maximilien

      (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

      Mircea NeacsuM Offline
      Mircea NeacsuM Offline
      Mircea Neacsu
      wrote on last edited by
      #2

      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
      rem

      if 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

      M 1 Reply Last reply
      0
      • Mircea NeacsuM Mircea Neacsu

        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
        rem

        if 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

        M Offline
        M Offline
        Maximilien
        wrote on last edited by
        #3

        Thanks I will look at it. :thumbsup:

        CI/CD = Continuous Impediment/Continuous Despair

        Mircea NeacsuM 1 Reply Last reply
        0
        • M Maximilien

          (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

          M Offline
          M Offline
          Member_15540010
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • M Maximilien

            Thanks I will look at it. :thumbsup:

            CI/CD = Continuous Impediment/Continuous Despair

            Mircea NeacsuM Offline
            Mircea NeacsuM Offline
            Mircea Neacsu
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups