Skip to content

Commit 5959d83

Browse files
committed
nuget: don't try to find msbuild (incorrectly)
With the changes in the way MSBuild is bundled and installed in Visual Studio 2015+, we can no longer use the old hacky way to find where msbuild is installed. This busted AppVeyor whose image has VS 2015 installed and an old (incompatible) version of msbuild installed elsewhere. We would find only the old version. Require nuget package users to have msbuild in their path.
1 parent a0e1f07 commit 5959d83

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

nuget.package/BuildNugetPackage.ps1

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,6 @@ function Clean-OutputFolder($folder) {
5252
}
5353
}
5454

55-
# From http://www.dougfinke.com/blog/index.php/2010/12/01/note-to-self-how-to-programmatically-get-the-msbuild-path-in-powershell/
56-
57-
Function Get-MSBuild {
58-
$lib = [System.Runtime.InteropServices.RuntimeEnvironment]
59-
$rtd = $lib::GetRuntimeDirectory()
60-
Join-Path $rtd msbuild.exe
61-
}
62-
6355
#################
6456

6557
$root = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
@@ -79,7 +71,7 @@ Push-Location $projectPath
7971
try {
8072
Set-Content -Encoding ASCII $(Join-Path $projectPath "libgit2sharp_hash.txt") $commitSha
8173
Run-Command { & "$(Join-Path $projectPath "..\Lib\NuGet\Nuget.exe")" Restore "$slnPath" }
82-
Run-Command { & (Get-MSBuild) "$slnPath" "/verbosity:minimal" "/p:Configuration=Release" }
74+
Run-Command { & "MSBuild.exe" "$slnPath" "/verbosity:minimal" "/p:Configuration=Release" }
8375

8476
If ($postBuild) {
8577
Write-Host -ForegroundColor "Green" "Run post build script..."

0 commit comments

Comments
 (0)