From 5fa1c241ecf1495cad89804fd11b29f39d2ee23c Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Wed, 20 Mar 2019 20:58:55 -0700 Subject: [PATCH 1/8] Move to BYOC queues - aspnet/AspNetCore-Internal#2033 - use conditions matching aspnet/Extensions and dotnet/Arcade - e.g. https://github.com/dotnet/arcade/blob/05cb24592af3989d8f274e68280a3c16520d2f71/azure-pipelines.yml#L49-L54 - install necessary Build Tools for Visual Studio 2019 components and workloads on CI - revert part of 85ae18c723 because multiple editions of VS 2019 are now publicly available - that is, restore support for multiple editions in InstallVisualStudio.ps1 - update InstallVisualStudio.ps1 to - support BuildTools edition of VS 2019 nit: merge a couple of Windows build steps - support automatically updating latest version of a VS edition on the machine - include `-Quiet` option for a completely non-interactive installation --- .azure/pipelines/jobs/default-build.yml | 34 +++++++---- eng/scripts/InstallVisualStudio.ps1 | 78 +++++++++++++++---------- eng/scripts/vs.buildtools.json | 30 ++++++++++ 3 files changed, 99 insertions(+), 43 deletions(-) create mode 100644 eng/scripts/vs.buildtools.json diff --git a/.azure/pipelines/jobs/default-build.yml b/.azure/pipelines/jobs/default-build.yml index f695d3c0af..c3a52548b9 100644 --- a/.azure/pipelines/jobs/default-build.yml +++ b/.azure/pipelines/jobs/default-build.yml @@ -6,7 +6,9 @@ # jobDisplayName: string # The friendly job name to display in the UI. Defaults to the name of the OS. # poolName: string -# The name of the VSTS agent queue to use. +# The name of the Azure DevOps agent pool to use. +# poolVmImage: string +# The name of a virtual machine image to use. Primarily of interest when using the Hosted pools. # agentOs: string # Used in templates to define variables which are OS specific. Typically from the set { Windows, Linux, macOS } # buildArgs: string @@ -47,6 +49,7 @@ parameters: agentOs: 'Windows' poolName: '' + poolVmImage: '' buildArgs: '' configuration: 'Release' beforeBuild: [] @@ -91,10 +94,12 @@ jobs: ${{ if ne(parameters.poolName, '') }}: name: ${{ parameters.poolName }} ${{ if and(eq(parameters.poolName, ''), eq(parameters.agentOs, 'Windows')) }}: - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - name: dotnet-internal-vs2019-preview - ${{ if ne(variables['System.TeamProject'], 'internal') }}: - name: dotnet-external-vs2019-preview + ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: + name: NetCorePublic-Int-Pool + queue: BuildPool.Windows.10.Amd64.VS2019.BT.Open + ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + name: NetCoreInternal-Int-Pool + queue: BuildPool.Windows.10.Amd64.VS2019.BT variables: AgentOsName: ${{ parameters.agentOs }} ASPNETCORE_TEST_LOG_MAXPATH: "200" # Keep test log file name length low enough for artifact zipping @@ -115,20 +120,25 @@ jobs: steps: - checkout: self clean: true + - ${{ if eq(parameters.agentOs, 'Windows') }}: + - powershell: ./eng/scripts/InstallVisualStudio.ps1 -Edition BuildTools -Quiet + displayName: Install Build Tools for Visual Studio 2019 - ${{ if eq(parameters.installNodeJs, 'true') }}: - task: NodeTool@0 displayName: Install Node 10.x inputs: versionSpec: 10.x - ${{ if and(eq(parameters.installJdk, 'true'), eq(parameters.agentOs, 'Windows')) }}: - - powershell: ./eng/scripts/InstallJdk.ps1 '11.0.1' + - powershell: | + ./eng/scripts/InstallJdk.ps1 '11.0.1' + Write-Host "##vso[task.prependpath]$env:JAVA_HOME\bin" + displayName: Install JDK 11 - - powershell: Write-Host "##vso[task.prependpath]$env:JAVA_HOME\bin" - displayName: Prepend JAVA bin folder to the PATH. - - powershell: Write-Host "##vso[task.setvariable variable=SeleniumProcessTrackingFolder]$(BuildDirectory)\obj\selenium\" - displayName: Add Selenium process tracking folder environment variable - - powershell: ./eng/scripts/InstallGoogleChrome.ps1 - displayName: Install chrome + - powershell: | + Write-Host "##vso[task.setvariable variable=SeleniumProcessTrackingFolder]$(BuildDirectory)\obj\selenium\" + ./eng/scripts/InstallGoogleChrome.ps1 + + displayName: Install Chrome - ${{ if and(eq(variables['System.TeamProject'], 'internal'), eq(parameters.agentOs, 'Windows'), eq(parameters.codeSign, 'true')) }}: - task: MicroBuildSigningPlugin@1 displayName: Install MicroBuild Signing plugin diff --git a/eng/scripts/InstallVisualStudio.ps1 b/eng/scripts/InstallVisualStudio.ps1 index 5d4f1bdd1b..0cd6589738 100644 --- a/eng/scripts/InstallVisualStudio.ps1 +++ b/eng/scripts/InstallVisualStudio.ps1 @@ -3,46 +3,40 @@ Installs or updates Visual Studio on a local developer machine. .DESCRIPTION This installs Visual Studio along with all the workloads required to contribute to this repository. - +.PARAMETER Edition + Selects which 'offering' of Visual Studio to install. Must be one of these values: + BuildTools + Community + Professional + Enterprise (the default) .PARAMETER InstallPath - The location of Visual Studio + 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\2019\`$Edition". .PARAMETER Passive Run the installer without requiring interaction. +.PARAMETER Quiet + Run the installer without UI and wait for installation to complete. .LINK https://visualstudio.com https://github.com/aspnet/AspNetCore/blob/master/docs/BuildFromSource.md .EXAMPLE - To install VS 2019 Preview, run this command in PowerShell: + To install VS 2019 Enterprise, run this command in PowerShell: .\InstallVisualStudio.ps1 #> [CmdletBinding(DefaultParameterSetName = 'Default')] param( - # TODO - once VS 2019 16.0 RTM is released, make this a parameter again - # .PARAMETER Edition - # Must be one of these values: - - # Community - # Professional - # Enterprise - - # Selects which 'offering' of Visual Studio to install. - - # [ValidateSet('Community', 'Professional', 'Enterprise')] - # [string]$Edition, + [ValidateSet('BuildTools','Community', 'Professional', 'Enterprise')] + [string]$Edition = 'Enterprise', [string]$InstallPath, - [switch]$Passive + [switch]$Passive, + [switch]$Quiet ) -# VS previews are only available publicly as 'Enterprise' versions. They should be available to the community to use without a paid license. -$Edition = 'Enterprise' - -if (-not $Edition) { - Write-Host "You must specify a value for the -Edition parameter which selects the kind of Visual Studio to install." -f Red +if ($Passive -and $Quiet) { + Write-Host "The -Passive and -Quiet options cannot be used together." -f Red Write-Host "Run ``Get-Help $PSCommandPath`` for more details." -f Red - Write-Host "" - Write-Host "Example: ./InstallVisualStudio -Edition Community" -f Red - Write-Host "" exit 1 } @@ -54,35 +48,57 @@ mkdir $intermedateDir -ErrorAction Ignore | Out-Null $bootstrapper = "$intermedateDir\vsinstaller.exe" $ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138 -Invoke-WebRequest -Uri "https://aka.ms/vs/16/pre/vs_$($Edition.ToLowerInvariant()).exe" -OutFile $bootstrapper +Invoke-WebRequest -Uri "https://aka.ms/vs/16/release/vs_$($Edition.ToLowerInvariant()).exe" -OutFile $bootstrapper + +$productId = "Microsoft.VisualStudio.Product.$Edition" +if (-not $InstallPath) { + $vsWhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" + if (Test-Path $vsWhere) + { + $InstallPath = &$vsWhere -version '[16,17)' -latest -prerelease -products $productId -property installationPath + } +} if (-not $InstallPath) { - # $InstallPath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\$Edition" - $InstallPath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\Preview" + $InstallPath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\$Edition" } # no backslashes - this breaks the installer $InstallPath = $InstallPath.TrimEnd('\') [string[]] $arguments = @() - if (Test-path $InstallPath) { $arguments += 'modify' } +$responseFile = "$PSScriptRoot\vs.json" +if ("$Edition" -eq "BuildTools") { + $responseFile = "$PSScriptRoot\vs.buildtools.json" +} + $arguments += ` - '--productId', "Microsoft.VisualStudio.Product.$Edition", ` + '--productId', $productId, ` '--installPath', "`"$InstallPath`"", ` - '--in', "$PSScriptRoot\vs.json", ` + '--in', "`"$responseFile`"", ` '--norestart' if ($Passive) { $arguments += '--passive' } +if ($Quiet) { + $arguments += '--quiet', '--wait' +} Write-Host "" Write-Host "Installing Visual Studio 2019 $Edition" -f Magenta Write-Host "" Write-Host "Running '$bootstrapper $arguments'" -& $bootstrapper @arguments +$process = Start-Process -FilePath "$bootstrapper" -ArgumentList $arguments ` + -PassThru -RedirectStandardError "$intermedateDir\errors.txt" -Verbose -Wait +if ($process.ExitCode -ne 0) { + Get-Content "$intermedateDir\errors.txt" | Write-Error +} + +Remove-Item "$intermedateDir\errors.txt" -errorAction SilentlyContinue +exit $process.ExitCode diff --git a/eng/scripts/vs.buildtools.json b/eng/scripts/vs.buildtools.json new file mode 100644 index 0000000000..1e1f8ca013 --- /dev/null +++ b/eng/scripts/vs.buildtools.json @@ -0,0 +1,30 @@ +{ + "channelUri": "https://aka.ms/vs/16/pre/channel", + "channelId": "VisualStudio.16.Preview", + "includeRecommended": false, + "addProductLang": [ + "en-US" + ], + "add": [ + "Microsoft.Net.Component.4.6.1.TargetingPack", + "Microsoft.Net.Component.4.6.2.TargetingPack", + "Microsoft.Net.Component.4.7.1.TargetingPack", + "Microsoft.Net.Component.4.7.2.SDK", + "Microsoft.Net.Component.4.7.2.TargetingPack", + "Microsoft.Net.Component.4.7.TargetingPack", + "Microsoft.VisualStudio.Component.FSharp.MSBuild", + "Microsoft.VisualStudio.Component.NuGet", + "Microsoft.VisualStudio.Component.NuGet.BuildTools", + "Microsoft.VisualStudio.Component.VC.ATL", + "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", + "Microsoft.VisualStudio.Component.VC.v141.ATL", + "Microsoft.VisualStudio.Component.VC.v141.x86.x64", + "Microsoft.VisualStudio.Component.Windows10SDK.17134", + "Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools", + "Microsoft.VisualStudio.Workload.MSBuildTools", + "Microsoft.VisualStudio.Workload.NetCoreBuildTools", + "Microsoft.VisualStudio.Workload.VCTools", + "Microsoft.VisualStudio.Workload.VisualStudioExtensionBuildTools", + "Microsoft.VisualStudio.Workload.WebBuildTools" + ] +} From 7fd65f52cf077142a6e691333ce93720a93f7fd6 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Sun, 24 Mar 2019 20:17:25 -0700 Subject: [PATCH 2/8] Install SQL Server 2017 Express LocalDB in Windows test job --- .azure/pipelines/ci.yml | 2 ++ eng/scripts/InstallSqlServerLocalDB.ps1 | 44 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 eng/scripts/InstallSqlServerLocalDB.ps1 diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 091eb3f90f..0f4c3dd39f 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -295,6 +295,8 @@ jobs: buildScript: ./eng/scripts/cibuild.cmd buildArgs: -test "/p:SkipIISBackwardsCompatibilityTests=true /p:SkipIISTests=true /p:SkipIISExpressTests=true /p:SkipIISForwardsCompatibilityTests=true" beforeBuild: + - powershell: ./eng/scripts/InstallSqlServerLocalDB.ps1 + displayName: Install SQL Server 2017 Express LocalDB - powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1" displayName: Setup IISExpress test certificates and schema - powershell: "& ./.azure/pipelines/tools/SetupTestEnvironment.ps1 Setup signalrclienttests.exe" diff --git a/eng/scripts/InstallSqlServerLocalDB.ps1 b/eng/scripts/InstallSqlServerLocalDB.ps1 new file mode 100644 index 0000000000..e31be1c216 --- /dev/null +++ b/eng/scripts/InstallSqlServerLocalDB.ps1 @@ -0,0 +1,44 @@ +<# +.SYNOPSIS + Installs SQL Server 2017 Express LocalDB on a machine. +.DESCRIPTION + This script installs Microsoft SQL Server 2016 Express LocalDB on a machine. +.LINK + https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-2016-express-localdb?view=sql-server-2017 + https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-2017 +#> + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 1 + +$intermedateDir = "$PSScriptRoot\obj" +mkdir $intermedateDir -ErrorAction Ignore | Out-Null + +$bootstrapper = "$intermedateDir\SQLExpressInstaller.exe" +$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138 + +Write-Host "Installing SQL Server 2017 Express LocalDB" -f Magenta + +# Get the bootstrapper. +Write-Host "" +Write-Host "Downloading 'SQLServer2017-SSEI-Expr.exe' to '$bootstrapper'." +Invoke-WebRequest -OutFile $bootstrapper -Uri ` + "https://download.microsoft.com/download/5/E/9/5E9B18CC-8FD5-467E-B5BF-BADE39C51F73/SQLServer2017-SSEI-Expr.exe" + +# Download SqlLocalDB.msi. +Write-Host "" +$arguments = '/Action=Download', '/Quiet', '/HideProgressBar', ` + '/MediaType=LocalDB', "/MediaPath=`"$intermedateDir`"", '/Language=en-us' +Write-Host "Running '`"$bootstrapper`" $arguments'." +$process = Start-Process "$bootstrapper" -ArgumentList $arguments -PassThru -Verbose -Wait +if ($process.ExitCode -ne 0) { + exit $process.ExitCode +} + +# Install LocalDB. +Write-Host "" +$arguments = '/package', "`"$intermedateDir\en-us\SqlLocalDB.msi`"", '/NoRestart', '/Passive', ` + 'IACCEPTSQLLOCALDBLICENSETERMS=YES', 'HIDEPROGRESSBAR=YES' +Write-Host "Running 'msiexec $arguments'." +$process = Start-Process msiexec.exe -ArgumentList $arguments -NoNewWindow -PassThru -Verbose -Wait +exit $process.ExitCode From 7a5981131cd49df4fa9d9a1622136389da443ef6 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Mon, 25 Mar 2019 12:40:41 -0700 Subject: [PATCH 3/8] Drop back to SQL Server 2016 Express LocalDB --- .azure/pipelines/ci.yml | 2 +- eng/scripts/InstallSqlServerLocalDB.ps1 | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 0f4c3dd39f..944af865a2 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -296,7 +296,7 @@ jobs: buildArgs: -test "/p:SkipIISBackwardsCompatibilityTests=true /p:SkipIISTests=true /p:SkipIISExpressTests=true /p:SkipIISForwardsCompatibilityTests=true" beforeBuild: - powershell: ./eng/scripts/InstallSqlServerLocalDB.ps1 - displayName: Install SQL Server 2017 Express LocalDB + displayName: Install SQL Server 2016 Express LocalDB - powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1" displayName: Setup IISExpress test certificates and schema - powershell: "& ./.azure/pipelines/tools/SetupTestEnvironment.ps1 Setup signalrclienttests.exe" diff --git a/eng/scripts/InstallSqlServerLocalDB.ps1 b/eng/scripts/InstallSqlServerLocalDB.ps1 index e31be1c216..a9d82f7972 100644 --- a/eng/scripts/InstallSqlServerLocalDB.ps1 +++ b/eng/scripts/InstallSqlServerLocalDB.ps1 @@ -1,11 +1,11 @@ <# .SYNOPSIS - Installs SQL Server 2017 Express LocalDB on a machine. + Installs SQL Server 2016 Express LocalDB on a machine. .DESCRIPTION This script installs Microsoft SQL Server 2016 Express LocalDB on a machine. .LINK - https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-2016-express-localdb?view=sql-server-2017 - https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-2017 + https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-2016-express-localdb?view=sql-server-2016 + https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-2016 #> $ErrorActionPreference = 'Stop' @@ -17,13 +17,13 @@ mkdir $intermedateDir -ErrorAction Ignore | Out-Null $bootstrapper = "$intermedateDir\SQLExpressInstaller.exe" $ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138 -Write-Host "Installing SQL Server 2017 Express LocalDB" -f Magenta +Write-Host "Installing SQL Server 2016 Express LocalDB" -f Magenta # Get the bootstrapper. Write-Host "" -Write-Host "Downloading 'SQLServer2017-SSEI-Expr.exe' to '$bootstrapper'." +Write-Host "Downloading 'SQLServer2016-SSEI-Expr.exe' to '$bootstrapper'." Invoke-WebRequest -OutFile $bootstrapper -Uri ` - "https://download.microsoft.com/download/5/E/9/5E9B18CC-8FD5-467E-B5BF-BADE39C51F73/SQLServer2017-SSEI-Expr.exe" + "https://download.microsoft.com/download/3/7/6/3767D272-76A1-4F31-8849-260BD37924E4/SQLServer2016-SSEI-Expr.exe" # Download SqlLocalDB.msi. Write-Host "" From 70d8d125f902598003b03fa2d51f1b62c0184e1c Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Mon, 25 Mar 2019 18:40:07 -0700 Subject: [PATCH 4/8] Instead: Install SQL Server 2017 Express LocalDB and its cumulative update --- .azure/pipelines/ci.yml | 2 +- eng/scripts/InstallSqlServerLocalDB.ps1 | 57 ++++++++++++++----------- 2 files changed, 34 insertions(+), 25 deletions(-) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 944af865a2..0f4c3dd39f 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -296,7 +296,7 @@ jobs: buildArgs: -test "/p:SkipIISBackwardsCompatibilityTests=true /p:SkipIISTests=true /p:SkipIISExpressTests=true /p:SkipIISForwardsCompatibilityTests=true" beforeBuild: - powershell: ./eng/scripts/InstallSqlServerLocalDB.ps1 - displayName: Install SQL Server 2016 Express LocalDB + displayName: Install SQL Server 2017 Express LocalDB - powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1" displayName: Setup IISExpress test certificates and schema - powershell: "& ./.azure/pipelines/tools/SetupTestEnvironment.ps1 Setup signalrclienttests.exe" diff --git a/eng/scripts/InstallSqlServerLocalDB.ps1 b/eng/scripts/InstallSqlServerLocalDB.ps1 index a9d82f7972..b5ab537415 100644 --- a/eng/scripts/InstallSqlServerLocalDB.ps1 +++ b/eng/scripts/InstallSqlServerLocalDB.ps1 @@ -1,44 +1,53 @@ <# .SYNOPSIS - Installs SQL Server 2016 Express LocalDB on a machine. + Installs SQL Server 2017 Express LocalDB on a machine. .DESCRIPTION - This script installs Microsoft SQL Server 2016 Express LocalDB on a machine. + This script installs Microsoft SQL Server 2017 Express LocalDB on a machine. .LINK - https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-2016-express-localdb?view=sql-server-2016 - https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-2016 + https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-2016-express-localdb?view=sql-server-2017 + https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-2017 #> $ErrorActionPreference = 'Stop' +$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138 Set-StrictMode -Version 1 $intermedateDir = "$PSScriptRoot\obj" mkdir $intermedateDir -ErrorAction Ignore | Out-Null -$bootstrapper = "$intermedateDir\SQLExpressInstaller.exe" -$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138 - -Write-Host "Installing SQL Server 2016 Express LocalDB" -f Magenta - -# Get the bootstrapper. -Write-Host "" -Write-Host "Downloading 'SQLServer2016-SSEI-Expr.exe' to '$bootstrapper'." -Invoke-WebRequest -OutFile $bootstrapper -Uri ` - "https://download.microsoft.com/download/3/7/6/3767D272-76A1-4F31-8849-260BD37924E4/SQLServer2016-SSEI-Expr.exe" +Write-Host "Installing SQL Server 2017 Express LocalDB" -f Magenta # Download SqlLocalDB.msi. +$installerFilename = "SqlLocalDB.msi" +$installerPath = "$intermedateDir\$installerFilename" Write-Host "" -$arguments = '/Action=Download', '/Quiet', '/HideProgressBar', ` - '/MediaType=LocalDB', "/MediaPath=`"$intermedateDir`"", '/Language=en-us' -Write-Host "Running '`"$bootstrapper`" $arguments'." -$process = Start-Process "$bootstrapper" -ArgumentList $arguments -PassThru -Verbose -Wait -if ($process.ExitCode -ne 0) { +Write-Host "Downloading '$installerFilename' to '$installerPath'." +Invoke-WebRequest -OutFile $installerPath -Uri ` + "https://download.microsoft.com/download/E/F/2/EF23C21D-7860-4F05-88CE-39AA114B014B/$installerFilename" + +# Install LocalDB. +$arguments = '/package', "`"$installerPath`"", '/NoRestart', '/Passive', ` + 'IACCEPTSQLLOCALDBLICENSETERMS=YES', 'HIDEPROGRESSBAR=YES' +Write-Host "" +Write-Host "Running 'msiexec $arguments'." +$process = Start-Process msiexec.exe -ArgumentList $arguments -NoNewWindow -PassThru -Verbose -Wait +if ($process.ExitCode -ne 0) +{ exit $process.ExitCode } -# Install LocalDB. +# Download SQLServer2017-KB4484710-x64.exe. +$installerFilename = "SQLServer2017-KB4484710-x64.exe" +$installerPath = "$intermedateDir\$installerFilename" Write-Host "" -$arguments = '/package', "`"$intermedateDir\en-us\SqlLocalDB.msi`"", '/NoRestart', '/Passive', ` - 'IACCEPTSQLLOCALDBLICENSETERMS=YES', 'HIDEPROGRESSBAR=YES' -Write-Host "Running 'msiexec $arguments'." -$process = Start-Process msiexec.exe -ArgumentList $arguments -NoNewWindow -PassThru -Verbose -Wait +Write-Host "Downloading SQL Server 2017 Cumulative Update 14 to '$installerPath'." +Invoke-WebRequest -OutFile $installerPath -Uri ` + "https://download.microsoft.com/download/C/4/F/C4F908C9-98ED-4E5F-88D5-7D6A5004AEBD/$installerFilename" + +# Update LocalDB. +$arguments = '/Action=Patch', '/AllInstances', '/IAcceptSQLServerLicenseTerms', ` + '/Quiet', '/SuppressPrivacyStatementNotice' +Write-Host "" +Write-Host "Running '`"$installerPath`" $arguments'." +$process = Start-Process "$installerPath" -ArgumentList $arguments -PassThru -Verbose -Wait exit $process.ExitCode From b55d69c3709f2fdfc460d7de9e18d4b18a7a79b2 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Tue, 26 Mar 2019 08:14:06 -0700 Subject: [PATCH 5/8] Don't move Microsoft.AspNetCore.Blazor.Templates.dll into output directory - assembly is not of interest and should not be signed --- .azure/pipelines/ci.yml | 1 + .../Templates/src/Microsoft.AspNetCore.Blazor.Templates.csproj | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 0f4c3dd39f..2d165fadc8 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -332,6 +332,7 @@ jobs: - name: MacOS_Test_Logs path: artifacts/logs/ publishOnError: true + - template: jobs/default-build.yml parameters: condition: ne(variables['SkipTests'], 'true') diff --git a/src/Components/Blazor/Templates/src/Microsoft.AspNetCore.Blazor.Templates.csproj b/src/Components/Blazor/Templates/src/Microsoft.AspNetCore.Blazor.Templates.csproj index f33d8fcc67..2210d666c5 100644 --- a/src/Components/Blazor/Templates/src/Microsoft.AspNetCore.Blazor.Templates.csproj +++ b/src/Components/Blazor/Templates/src/Microsoft.AspNetCore.Blazor.Templates.csproj @@ -6,6 +6,8 @@ False False False + false + false 2008 Templates for ASP.NET Core Blazor projects. false From 651b14b727f300887e1219b048d4a46b1919faa4 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Tue, 26 Mar 2019 19:35:09 -0700 Subject: [PATCH 6/8] Revert most of "Don't move Microsoft.AspNetCore.Blazor.Templates.dll into output directory" - didn't help odd attempt to sign this file and it was only a warning This reverts commit b55d69c3709f2fdfc460d7de9e18d4b18a7a79b2. --- .../Templates/src/Microsoft.AspNetCore.Blazor.Templates.csproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Components/Blazor/Templates/src/Microsoft.AspNetCore.Blazor.Templates.csproj b/src/Components/Blazor/Templates/src/Microsoft.AspNetCore.Blazor.Templates.csproj index 2210d666c5..f33d8fcc67 100644 --- a/src/Components/Blazor/Templates/src/Microsoft.AspNetCore.Blazor.Templates.csproj +++ b/src/Components/Blazor/Templates/src/Microsoft.AspNetCore.Blazor.Templates.csproj @@ -6,8 +6,6 @@ False False False - false - false 2008 Templates for ASP.NET Core Blazor projects. false From 45480b10ae8b660f9ac4f3546b28d8535126c265 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Tue, 26 Mar 2019 19:51:18 -0700 Subject: [PATCH 7/8] Back to using SQL Server 2016 Express LocalDB again - installing cumulative update was taking extra time and not reliably updating the LocalDB install - reverts part of 70d8d125f9, leaving direct download and some reordering --- .azure/pipelines/ci.yml | 2 +- eng/scripts/InstallSqlServerLocalDB.ps1 | 31 +++++-------------------- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 2d165fadc8..99fa34187a 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -296,7 +296,7 @@ jobs: buildArgs: -test "/p:SkipIISBackwardsCompatibilityTests=true /p:SkipIISTests=true /p:SkipIISExpressTests=true /p:SkipIISForwardsCompatibilityTests=true" beforeBuild: - powershell: ./eng/scripts/InstallSqlServerLocalDB.ps1 - displayName: Install SQL Server 2017 Express LocalDB + displayName: Install SQL Server 2016 Express LocalDB - powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1" displayName: Setup IISExpress test certificates and schema - powershell: "& ./.azure/pipelines/tools/SetupTestEnvironment.ps1 Setup signalrclienttests.exe" diff --git a/eng/scripts/InstallSqlServerLocalDB.ps1 b/eng/scripts/InstallSqlServerLocalDB.ps1 index b5ab537415..807d0e68a2 100644 --- a/eng/scripts/InstallSqlServerLocalDB.ps1 +++ b/eng/scripts/InstallSqlServerLocalDB.ps1 @@ -1,11 +1,11 @@ <# .SYNOPSIS - Installs SQL Server 2017 Express LocalDB on a machine. + Installs SQL Server 2016 Express LocalDB on a machine. .DESCRIPTION - This script installs Microsoft SQL Server 2017 Express LocalDB on a machine. + This script installs Microsoft SQL Server 2016 Express LocalDB on a machine. .LINK - https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-2016-express-localdb?view=sql-server-2017 - https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-2017 + https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-2016-express-localdb?view=sql-server-2016 + https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt?view=sql-server-2016 #> $ErrorActionPreference = 'Stop' @@ -15,7 +15,7 @@ Set-StrictMode -Version 1 $intermedateDir = "$PSScriptRoot\obj" mkdir $intermedateDir -ErrorAction Ignore | Out-Null -Write-Host "Installing SQL Server 2017 Express LocalDB" -f Magenta +Write-Host "Installing SQL Server 2016 Express LocalDB" -f Magenta # Download SqlLocalDB.msi. $installerFilename = "SqlLocalDB.msi" @@ -23,7 +23,7 @@ $installerPath = "$intermedateDir\$installerFilename" Write-Host "" Write-Host "Downloading '$installerFilename' to '$installerPath'." Invoke-WebRequest -OutFile $installerPath -Uri ` - "https://download.microsoft.com/download/E/F/2/EF23C21D-7860-4F05-88CE-39AA114B014B/$installerFilename" + "https://download.microsoft.com/download/9/0/7/907AD35F-9F9C-43A5-9789-52470555DB90/ENU/SqlLocalDB.msi" # Install LocalDB. $arguments = '/package', "`"$installerPath`"", '/NoRestart', '/Passive', ` @@ -31,23 +31,4 @@ $arguments = '/package', "`"$installerPath`"", '/NoRestart', '/Passive', ` Write-Host "" Write-Host "Running 'msiexec $arguments'." $process = Start-Process msiexec.exe -ArgumentList $arguments -NoNewWindow -PassThru -Verbose -Wait -if ($process.ExitCode -ne 0) -{ - exit $process.ExitCode -} - -# Download SQLServer2017-KB4484710-x64.exe. -$installerFilename = "SQLServer2017-KB4484710-x64.exe" -$installerPath = "$intermedateDir\$installerFilename" -Write-Host "" -Write-Host "Downloading SQL Server 2017 Cumulative Update 14 to '$installerPath'." -Invoke-WebRequest -OutFile $installerPath -Uri ` - "https://download.microsoft.com/download/C/4/F/C4F908C9-98ED-4E5F-88D5-7D6A5004AEBD/$installerFilename" - -# Update LocalDB. -$arguments = '/Action=Patch', '/AllInstances', '/IAcceptSQLServerLicenseTerms', ` - '/Quiet', '/SuppressPrivacyStatementNotice' -Write-Host "" -Write-Host "Running '`"$installerPath`" $arguments'." -$process = Start-Process "$installerPath" -ArgumentList $arguments -PassThru -Verbose -Wait exit $process.ExitCode From f7440bed67c4b39471fc9b91b98c2f97eee2c6fe Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Tue, 26 Mar 2019 22:25:16 -0700 Subject: [PATCH 8/8] Do not assume vsjitdebuger.exe exists - component is not available in BuildTools edition of VS --- .azure/pipelines/tools/SetupTestEnvironment.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure/pipelines/tools/SetupTestEnvironment.ps1 b/.azure/pipelines/tools/SetupTestEnvironment.ps1 index f985bfa087..e92b76304b 100644 --- a/.azure/pipelines/tools/SetupTestEnvironment.ps1 +++ b/.azure/pipelines/tools/SetupTestEnvironment.ps1 @@ -77,7 +77,7 @@ function Setup-Dumps() function Shutdown-Dumps() { - Move-Item $env:windir\System32\_vsjitdebugger.exe $env:windir\System32\vsjitdebugger.exe; + Move-Item $env:windir\System32\_vsjitdebugger.exe $env:windir\System32\vsjitdebugger.exe -ErrorAction Ignore; Remove-Item $ldHive -Recurse -Force