Skip to content
代码片段 群组 项目
未验证 提交 45376ce1 编辑于 作者: Damian Edwards's avatar Damian Edwards 提交者: GitHub
浏览文件

Remove VS2019 from install script (#40694)

- Update InstallVisualStudio.ps1 to only support VS2022
- Add support for IntPreview (dogfood) channel, e.g. InstallVisualStudio.ps1 -Channel Dogfood
- Update the build from source docs to refer to VS2022
- Remove trailing whitespace in VS installer manifest files
上级 74e885aa
No related branches found
No related tags found
无相关合并请求
......@@ -72,25 +72,26 @@ Building ASP.NET Core on Windows (10, version 1803 or newer) requires that you h
> :bulb: Be sure you have least 10 GB of disk space and a good Internet connection. The build scripts will download several tools and dependencies onto your machine.
#### [Visual Studio 2019](https://visualstudio.com)
#### [Visual Studio 2022](https://visualstudio.com)
Visual Studio 2019 (16.10 Preview 3) is required to build the repo locally. If you don't have visual studio installed you can run [eng/scripts/InstallVisualStudio.ps1](/eng/scripts/InstallVisualStudio.ps1) to install the exact required dependencies.
Visual Studio 2022 (17.1 or above) is required to build the repo locally. If you don't have Visual Studio installed you can run [eng/scripts/InstallVisualStudio.ps1](/eng/scripts/InstallVisualStudio.ps1) to install the exact required dependencies.
> :bulb: By default, the script will install Visual Studio Enterprise Edition, however you can use a different edition by passing the `-Edition` flag.
> :bulb: To install Visual Studio from the preview channel, you can use the `-Channel` flag to set the channel (`-Channel Preview`).
> :bulb: Even if you have installed Visual Studio, we still recommend using this script to install again to avoid errors due to missing components.
> :bulb: To update an existing Visual Studio installation or customize the installation path, you can use the `-InstallPath` flag (`-InstallPath "D:\Program Files\Microsoft Visual Studio\2022\Enterprise"`).
```powershell
./eng/scripts/InstallVisualStudio.ps1 [-Edition {Enterprise|Community|Professional}] [-Channel {Release|Preview}]
./eng/scripts/InstallVisualStudio.ps1 [-Edition {Enterprise|Community|Professional}] [-Channel {Release|Preview}]
```
> :bulb: To execute the setup script or other PowerShell scripts in the repo, you may need to update the execution policy on your machine.
> You can do so by running the `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser` command
> in PowerShell. For more information on execution policies, you can read the [execution policy docs](https://docs.microsoft.com/powershell/module/microsoft.powershell.security/set-executionpolicy).
The [global.json](/global.json) file specifies the minimum requirements needed to build using `msbuild`. The [eng/scripts/vs.16.json](/eng/scripts/vs.16.json) file provides a description of the components needed to build within VS. If you plan on developing in Visual Studio, you will need to have these components installed.
The [global.json](/global.json) file specifies the minimum requirements needed to build using `msbuild`. The [eng/scripts/vs.17.json](/eng/scripts/vs.17.json) file provides a description of the components needed to build within Visual Studio. If you plan on developing in Visual Studio, you will need to have these components installed.
> :bulb: The `InstallVisualStudio.ps1` script mentioned above reads from the `vs.17.json` file to determine what components to install.
> :bulb: The `InstallVisualStudio.ps1` script mentioned above reads from the `vs.17[.channel].json` file to determine what components to install.
#### [Git](https://git-scm.org) on Windows
......
......@@ -15,12 +15,11 @@
Preview
.PARAMETER Version
Selects which version of Visual Studio to install. Must be one of these values:
2019 (the default)
2022
.PARAMETER InstallPath
The location on disk where Visual Studio should be installed or updated. Default path is location of latest
existing installation of the specified edition, if any. If that VS edition is not currently installed, default
path is '${env:ProgramFiles(x86)}\Microsoft Visual Studio\`$Version\`$Edition".
path is '${env:ProgramFiles}\Microsoft Visual Studio\`$Version\`$Edition".
.PARAMETER Passive
Run the installer without requiring interaction.
.PARAMETER Quiet
......@@ -29,17 +28,17 @@
https://visualstudio.com
https://github.com/dotnet/aspnetcore/blob/main/docs/BuildFromSource.md
.EXAMPLE
To install VS 2019 Enterprise, run this command in PowerShell:
To install VS 2022 Enterprise, run this command in PowerShell:
.\InstallVisualStudio.ps1
#>
param(
[ValidateSet('BuildTools','Community', 'Professional', 'Enterprise')]
[string]$Edition = 'Enterprise',
[ValidateSet('Release', 'Preview')]
[ValidateSet('Release', 'Preview', 'IntPreview', 'Dogfood')]
[string]$Channel = 'Release',
[ValidateSet('2019', '2022')]
[string]$Version = '2019',
[ValidateSet('2022')]
[string]$Version = '2022',
[string]$InstallPath,
[switch]$Passive,
[switch]$Quiet
......@@ -65,9 +64,6 @@ mkdir $intermedateDir -ErrorAction Ignore | Out-Null
$bootstrapper = "$intermedateDir\vsinstaller.exe"
$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
if ("$Version" -eq "2019") {
$vsversion = 16;
}
if ("$Version" -eq "2022") {
$vsversion = 17;
}
......@@ -76,9 +72,15 @@ $responseFileName = "vs.$vsversion"
if ("$Edition" -eq "BuildTools") {
$responseFileName += ".buildtools"
}
if ("$Channel" -eq "Dogfood") {
$Channel = "IntPreview"
}
if ("$Channel" -eq "Preview") {
$responseFileName += ".preview"
$channelUri = "https://aka.ms/vs/$vsversion/pre"
} elseif ("$Channel" -eq "IntPreview") {
$responseFileName += ".intpreview"
$channelUri = "https://aka.ms/vs/$vsversion/intpreview"
}
$responseFile = "$PSScriptRoot\$responseFileName.json"
......@@ -105,14 +107,13 @@ if (-not $InstallPath) {
}
if (-not $InstallPath) {
if ($vsversion -eq "16") {
$pathPrefix = "${env:ProgramFiles(x86)}";
}
if ($vsversion -eq "17") {
$pathPrefix = "${env:ProgramFiles}";
}
if ("$Channel" -eq "Preview") {
$InstallPath = "$pathPrefix\Microsoft Visual Studio\$Version\${Edition}_Pre"
} elseif ("$Channel" -eq "IntPreview") {
$InstallPath = "$pathPrefix\Microsoft Visual Studio\$Version\${Edition}_IntPre"
} else {
$InstallPath = "$pathPrefix\Microsoft Visual Studio\$Version\$Edition"
}
......
{
"channelUri": "https://aka.ms/vs/16/pre/channel",
"channelId": "VisualStudio.16.Preview",
"includeRecommended": false,
"addProductLang": [
"en-US"
],
"add": [
"Microsoft.Net.Component.4.6.2.TargetingPack",
"Microsoft.Net.Component.4.7.2.SDK",
"Microsoft.Net.Component.4.7.2.TargetingPack",
"Microsoft.VisualStudio.Component.FSharp.MSBuild",
"Microsoft.VisualStudio.Component.NuGet",
"Microsoft.VisualStudio.Component.NuGet.BuildTools",
"Microsoft.VisualStudio.Component.VC.ATL",
"Microsoft.VisualStudio.Component.VC.ATL.ARM64",
"Microsoft.VisualStudio.Component.VC.Tools.ARM64",
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"Microsoft.VisualStudio.Component.Windows10SDK.18362",
"Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools",
"Microsoft.VisualStudio.Workload.MSBuildTools",
"Microsoft.VisualStudio.Workload.NetCoreBuildTools",
"Microsoft.VisualStudio.Workload.VCTools",
"Microsoft.VisualStudio.Workload.VisualStudioExtensionBuildTools",
"Microsoft.VisualStudio.Workload.WebBuildTools"
]
}
{
"channelUri": "https://aka.ms/vs/16/pre/channel",
"channelId": "VisualStudio.16.Preview",
"includeRecommended": false,
"addProductLang": [
"en-US"
],
"add": [
"Microsoft.Net.Component.4.6.2.TargetingPack",
"Microsoft.Net.Component.4.7.2.SDK",
"Microsoft.Net.Component.4.7.2.TargetingPack",
"Microsoft.VisualStudio.Component.VC.ATL",
"Microsoft.VisualStudio.Component.VC.ATL.ARM64",
"Microsoft.VisualStudio.Component.VC.Tools.ARM64",
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"Microsoft.VisualStudio.Component.Windows10SDK.18362",
"Microsoft.VisualStudio.Workload.ManagedDesktop",
"Microsoft.VisualStudio.Workload.NativeDesktop",
"Microsoft.VisualStudio.Workload.NetCoreTools",
"Microsoft.VisualStudio.Workload.NetWeb",
"Microsoft.VisualStudio.Workload.VisualStudioExtension"
]
}
{
"channelUri": "https://aka.ms/vs/16/release/channel",
"channelId": "VisualStudio.16.Release",
"channelUri": "https://aka.ms/vs/17/intpreview/channel",
"channelId": "VisualStudio.17.IntPreview",
"includeRecommended": false,
"addProductLang": [
"en-US"
......@@ -16,6 +16,10 @@
"Microsoft.VisualStudio.Component.VC.ATL.ARM64",
"Microsoft.VisualStudio.Component.VC.Tools.ARM64",
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ARM64",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL.ARM64",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL",
"Microsoft.VisualStudio.Component.Windows10SDK.18362",
"Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools",
"Microsoft.VisualStudio.Workload.MSBuildTools",
......
......@@ -19,7 +19,7 @@
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ARM64",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL.ARM64",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL",
"Microsoft.VisualStudio.Component.Windows10SDK.18362",
"Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools",
"Microsoft.VisualStudio.Workload.MSBuildTools",
......
......@@ -19,7 +19,7 @@
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ARM64",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL.ARM64",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL",
"Microsoft.VisualStudio.Component.Windows10SDK.18362",
"Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools",
"Microsoft.VisualStudio.Workload.MSBuildTools",
......
{
"channelUri": "https://aka.ms/vs/16/release/channel",
"channelId": "VisualStudio.16.Release",
"channelUri": "https://aka.ms/vs/17/intpreview/channel",
"channelId": "VisualStudio.17.IntPreview",
"includeRecommended": false,
"addProductLang": [
"en-US"
......@@ -13,10 +13,13 @@
"Microsoft.VisualStudio.Component.VC.ATL.ARM64",
"Microsoft.VisualStudio.Component.VC.Tools.ARM64",
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ARM64",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL.ARM64",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL",
"Microsoft.VisualStudio.Component.Windows10SDK.18362",
"Microsoft.VisualStudio.Workload.ManagedDesktop",
"Microsoft.VisualStudio.Workload.NativeDesktop",
"Microsoft.VisualStudio.Workload.NetCoreTools",
"Microsoft.VisualStudio.Workload.NetWeb",
"Microsoft.VisualStudio.Workload.VisualStudioExtension"
]
......
......@@ -16,7 +16,7 @@
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ARM64",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL.ARM64",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL",
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL",
"Microsoft.VisualStudio.Component.Windows10SDK.18362",
"Microsoft.VisualStudio.Workload.ManagedDesktop",
"Microsoft.VisualStudio.Workload.NativeDesktop",
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册