8

I installed the Visual Studio 2019 in my working machine and I noticed the following:

With Visual Studio 2017, the msbuild.exe path is:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin

With Visual Studio 2019, the msbuild.exe path is:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin

There is also a directory with version 15.0, but mine is empty

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\15.0\Bin

What is the goal to use the "Current" folder instead of "15.0"?

Thanks.

pncsoares
  • 81
  • 1
  • 1
  • 4
  • What problem are you trying to solve. Microsoft changed the directory structure for MSBuild with VS2019. – Ramhound May 20 '19 at 11:55
  • I dont have errors or problems in the deployment. I just wanted to know if it's normal to have a folder named "Current" instead of "15.0" or another version. – pncsoares May 20 '19 at 14:05
  • You should ask if the directory path is correct, asking "what the goal is", isn't something we can answer. We are not Microsoft we cannot explain the reason the path changed, only confirm, if the path is correct. – Ramhound May 20 '19 at 15:21
  • Sorry for that but maybe someone here could work in Microsoft os just know. Meanwhile, is this path correct? Should I use this path to configure my automatic application deploy that executes the msbuild.exe file? – pncsoares May 20 '19 at 18:52
  • It certainly is the default MSBuild path for VS2019. – Ramhound May 20 '19 at 19:42

2 Answers2

9

MSBuild is now located inside the Visual Studio folder.

For example:

  • c:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\
  • c:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\
  • c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\

To dynamically find Visual Studio the following can be used:

  • "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath

    • D:\Program Files (x86)\Microsoft Visual Studio\2019\Professional
James Skemp
  • 547
  • 3
  • 6
  • 21
vitrilo
  • 191
  • 1
  • 4
  • 'C:\Program' is not recognized as an internal or external command, – Snowcrash Apr 08 '20 at 20:16
  • 3
    @Snowcrash in cmd - you should add quotes around path with spaces and escape if needed: cd "c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin" – vitrilo Apr 17 '20 at 15:52
0

From @vitrilo comment, using PowerShell this worked for me:

New-Alias -Name vswhere -Value "${Env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath

Outputs:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional
marckassay
  • 254
  • 2
  • 4