Skip to content

Use min VS version in tools.ps1 InitializeVisualStudioMSBuild if global.json doesn't provide it#10160

Merged
akoeplinger merged 2 commits intodotnet:mainfrom
akoeplinger:fix-msbuildengine-vs
Aug 10, 2022
Merged

Use min VS version in tools.ps1 InitializeVisualStudioMSBuild if global.json doesn't provide it#10160
akoeplinger merged 2 commits intodotnet:mainfrom
akoeplinger:fix-msbuildengine-vs

Conversation

@akoeplinger
Copy link
Copy Markdown
Member

@akoeplinger akoeplinger commented Jul 27, 2022

Otherwise running eng\common\build.ps1 -msbuildEngine vs results in an error if the global.json doesn't have a vs key (like we do in dotnet/runtime):

The property 'vs' cannot be found on this object. Verify that the property exists.

This is similar to what we do in

if( -not ($GlobalJson.tools.PSObject.Properties.Name -contains "vs" )) {
$GlobalJson.tools | Add-Member -Name "vs" -Value (ConvertFrom-Json "{ `"version`": `"16.5`" }") -MemberType NoteProperty
}

…al.json doesn't provide it

Otherwise running `eng\common\build.ps1 -msbuildEngine vs` results in an error if the global.json doesn't have a `vs` key:

```
The property 'vs' cannot be found on this object. Verify that the property exists.
```

This is similar to what we do in https://github.com/dotnet/arcade/blob/b2dad1fa64b4b80f7f4480782cf4ebf2f5fbbcda/eng/common/sdk-task.ps1#L63-L65
@akoeplinger akoeplinger requested review from MattGal and chcosta July 27, 2022 18:31
@akoeplinger akoeplinger requested a review from premun August 8, 2022 12:38
premun
premun previously approved these changes Aug 9, 2022
@akoeplinger
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@akoeplinger akoeplinger merged commit fd99417 into dotnet:main Aug 10, 2022
@akoeplinger akoeplinger deleted the fix-msbuildengine-vs branch August 11, 2022 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants