This project has moved. For the latest updates, please go here.


Invoke-MsBuild is not able to build project in VS 2015


Hey Guys

I am using PS to build project from VS2015 but seems like this script is not able to build project in VS 2015.
Could anyone please help with it or can give any pointers to solve the problem or is there any settings we need to do?

I am using VS 2015 on win 10.
Closed Dec 16, 2015 at 4:52 PM by deadlydog
Fixed in version 1.6.0.


sumedhrtv wrote Oct 16, 2015 at 8:11 AM

This issue was occurring on my machine since i was having latest vs version installed on my m/c and as a part of this script we're checking vs till 9
$VsVersion = Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\VisualStudio\' | Where{$_ -match '[0-9].'} |sort pschildname -Descending | select -first 1 -ExpandProperty pschildname

matching these versions to latest Vs as
$VsVersion = Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\VisualStudio\' | Where{$_ -match '[0-14].'} |sort pschildname -Descending | select -first 1 -ExpandProperty pschildname will solve the issue.

Since latest VS calculated is below 9

    $MsBuildVersion = (Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' | sort pschildname -Descending | select -first 1 -ExpandProperty pschildname).Substring(1)
-- was getting executed instead of

if([version]$VsVersion -ge [version]"12.0")
    $MsBuildVersion = $VsVersion
In above "else" we're checking HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP registry entry, which is located in different place in case of win 10 hence causing the problem.

deadlydog wrote Oct 29, 2015 at 8:46 AM

Hi sumedhrtv, for some reason CodePlex only emailed me about this issue and your comment today. I've updated the script to 1.6.0 to not use that missing registry key anymore. Unfortunately I do not have a Windows 10 machine to test the changes on. Can you try it and let me know if 1.6.0 works properly for you on Windows 10 with VS 2015 please.

luizbon wrote Dec 16, 2015 at 12:53 PM

Tested on a Win 10 machine with VS2015 and worked!