Skip to content

Commit c3013e1

Browse files
authored
Fix the .NET SDK installer script used by MRT Core, and don't run the script anymore (#2640)
* Fix the .NET SDK install script. * Remove .NET SDK version from global.json file. * Don't run the DownloadDotNetCoreSdk.ps1 script in the pipeline.
1 parent 8e96a74 commit c3013e1

3 files changed

Lines changed: 15 additions & 20 deletions

File tree

build/build-mrt.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,19 @@ steps:
7878
# PathtoPublish: '${{ parameters.MRTSourcesDirectory }}\msbuild-install-logs'
7979
# artifactName: 'installlogs'
8080

81-
- task: powershell@2
82-
displayName: 'Installing .NET SDK'
83-
inputs:
84-
targetType: filePath
85-
workingDirectory: ${{ parameters.MRTSourcesDirectory }}\build
86-
filePath: ${{ parameters.MRTSourcesDirectory }}\build\DownloadDotNetCoreSdk.ps1
87-
88-
- task: BatchScript@1
89-
displayName: 'Use .NET SDK'
90-
inputs:
91-
filename: '${{ parameters.MRTSourcesDirectory }}\build\SetDotnetVars.cmd'
92-
arguments: '${{ parameters.MRTSourcesDirectory }}'
93-
modifyEnvironment: true
81+
# - task: powershell@2
82+
# displayName: 'Installing .NET SDK'
83+
# inputs:
84+
# targetType: filePath
85+
# workingDirectory: ${{ parameters.MRTSourcesDirectory }}\build
86+
# filePath: ${{ parameters.MRTSourcesDirectory }}\build\DownloadDotNetCoreSdk.ps1
87+
88+
# - task: BatchScript@1
89+
# displayName: 'Use .NET SDK'
90+
# inputs:
91+
# filename: '${{ parameters.MRTSourcesDirectory }}\build\SetDotnetVars.cmd'
92+
# arguments: '${{ parameters.MRTSourcesDirectory }}'
93+
# modifyEnvironment: true
9494

9595
- task: powershell@2
9696
displayName: 'Create test pfx to sign MSIX test packages (DevCheck)'

dev/MRTCore/build/DownloadDotNetCoreSdk.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ param(
77
$dotnetInstallScript = "$env:TEMP\dotnet-install.ps1"
88

99
$repoInstallDir = [System.IO.Path]::GetFullPath("$PSScriptRoot\..\.dotnet")
10-
$versionPropsFilePropertyGroup = ([xml](Get-Content -Raw "$PSScriptRoot\..\..\..\eng\versions.props")).Project.PropertyGroup[0]
10+
$versionPropsFilePropertyGroup = ([xml](Get-Content -Raw "$PSScriptRoot\..\..\..\eng\versions.props")).Project.PropertyGroup
1111
$dotNetSdkVersion = $versionPropsFilePropertyGroup.CsWinRTDependencyDotNetCoreSdkPackageVersion
1212
$dotNetSdkVersionLkg = if (-not $skipLKG) { $versionPropsFilePropertyGroup.CsWinRTDependencyDotNetCoreSdkLkgPackageVersion }
1313

@@ -108,7 +108,7 @@ $latestAlreadyInstalled = Is-Installed $dotNetSdkVersion
108108
$lkgAlreadyInstalled = $true
109109

110110
# Only try to install the lkg sdk if specified
111-
if (-not [string]::IsNullOrEmpty($dotNetSdkVersionLkg))
111+
if ((-not [string]::IsNullOrEmpty($dotNetSdkVersionLkg)) -and ($dotNetSdkVersionLkg -ine '$(CsWinRTDependencyDotNetCoreSdkPackageVersion)'))
112112
{
113113
$lkgAlreadyInstalled = Is-Installed $dotNetSdkVersionLkg
114114
}
@@ -161,4 +161,3 @@ if (-not $lkgAlreadyInstalled)
161161
{
162162
Install-SDK -version $dotNetSdkVersionLkg -channel "master"
163163
}
164-

dev/MRTCore/global.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
{
2-
"sdk": {
3-
"version": "5.0.404",
4-
"rollForward": "latestMajor"
5-
},
62
"msbuild-sdks": {
73
"Microsoft.Build.NoTargets" : "1.0.88"
84
}

0 commit comments

Comments
 (0)