Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Aug 10, 2022

Conversation

akoeplinger
Copy link
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
premun
premun previously approved these changes Aug 9, 2022
eng/common/tools.ps1 Outdated Show resolved Hide resolved
@akoeplinger
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

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