Skip to content

Commit d754ca9

Browse files
committed
Add missing framework references for WinUI.
* Added missing framework references * Updated license headers on PowerShell files * Included a script to install required Windows SDK
1 parent 3d827a6 commit d754ca9

File tree

2 files changed

+17
-28
lines changed

2 files changed

+17
-28
lines changed

scripts/Install-WindowsSDK.ps1

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,18 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
function Write-Log ([string] $message, $messageColor = "Green") {
5-
$currentColor = $Host.UI.RawUI.ForegroundColor
6-
$Host.UI.RawUI.ForegroundColor = $messageColor
7-
if ($message) {
8-
Write-Output "... $message"
9-
}
10-
$Host.UI.RawUI.ForegroundColor = $currentColor
11-
}
12-
13-
Push-Location
14-
try {
15-
Write-Log "Downloading the Windows SDK 10.0.14393.795..."
16-
Invoke-WebRequest -Method Get -Uri https://go.microsoft.com/fwlink/p/?LinkId=838916 -OutFile sdksetup.exe -UseBasicParsing
4+
Write-Host "Downloading Windows SDK 10.0.14393.795..." -ForegroundColor "Green"
5+
Invoke-WebRequest -Method Get -Uri https://go.microsoft.com/fwlink/p/?LinkId=838916 -OutFile sdksetup.exe -UseBasicParsing
176

18-
Write-Log "Installing the Windows SDK, setup might request elevation please approve."
19-
$process = Start-Process -Wait sdksetup.exe -ArgumentList "/quiet", "/norestart", "/ceip off", "/features OptionId.WindowsSoftwareDevelopmentKit" -PassThru
20-
Remove-Item sdksetup.exe -Force
7+
Write-Host "Installing Windows SDK, setup might request elevation please approve." -ForegroundColor "Green"
8+
$process = Start-Process -Wait sdksetup.exe -ArgumentList "/quiet", "/norestart", "/ceip off", "/features OptionId.WindowsSoftwareDevelopmentKit" -PassThru
9+
Remove-Item sdksetup.exe -Force
2110

22-
if($process.ExitCode -eq 0)
23-
{
24-
Write-Log "Done"
25-
}
26-
else
27-
{
28-
Write-Log "Failed (Exit code: $($process.ExitCode))" -messageColor "Red"
29-
}
11+
if($process.ExitCode -eq 0)
12+
{
13+
Write-Host "Done" -ForegroundColor "Green"
3014
}
31-
finally {
32-
Pop-Location
33-
}
34-
15+
else
16+
{
17+
Write-Error "Failed to install Windows SDK (Exit code: $($process.ExitCode))"
18+
}

src/TestFramework/Extension.WinUI/Extension.WinUI.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
2121
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
2222
</PropertyGroup>
23+
24+
<ItemGroup>
25+
<FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" RuntimeFrameworkVersion="10.0.18362.16" />
26+
<FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" TargetingPackVersion="10.0.18362.16" />
27+
</ItemGroup>
2328

2429
<ItemGroup>
2530
<ProjectReference Include="$(RepoRoot)src\TestFramework\MSTest.Core\MSTest.Core.csproj" />

0 commit comments

Comments
 (0)