Skip to content

Commit 821075b

Browse files
committed
Calc: Step 2: Make Calculator reference WinAppSDK
1 parent b191a68 commit 821075b

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

Samples/Islands/DrawingIsland/CalculatorDemo/CalculatorDemo.csproj

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net9.0-windows</TargetFramework>
3+
<!-- WinAppSDK requires at least the 17763 build of windows, so we need to set that here.
4+
You can set this in the Visual Studio project properties UI too. -->
5+
<TargetFramework>net9.0-windows10.0.17763.0</TargetFramework>
46
<UseWpf>true</UseWpf>
57
<EnableDefaultItems>false</EnableDefaultItems>
68
<Platforms>x64;ARM64;x86</Platforms>
9+
10+
<!-- When adding a reference to WinAppSDK, we need to enable only the RIDs for the platforms WinAppSDK supprts. -->
11+
<RuntimeIdentifiers>win-x64;win-x86;win-arm64</RuntimeIdentifiers>
12+
13+
<!-- These flags turn off some WinAppSDK features we won't be using. -->
14+
<UseWinUITools>false</UseWinUITools>
15+
<EnableCoreMrtTooling>false</EnableCoreMrtTooling>
716
</PropertyGroup>
817
<PropertyGroup>
918
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -74,8 +83,6 @@
7483
<ErrorReport>prompt</ErrorReport>
7584
<WarningLevel>4</WarningLevel>
7685
</PropertyGroup>
77-
<ItemGroup>
78-
</ItemGroup>
7986
<ItemGroup>
8087
<ApplicationDefinition Include="App.xaml">
8188
<Generator>MSBuild:Compile</Generator>
@@ -119,6 +126,9 @@
119126
<ItemGroup>
120127
<None Include="App.config" />
121128
</ItemGroup>
129+
<ItemGroup>
130+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240428000" />
131+
</ItemGroup>
122132
<ItemGroup>
123133
<Resource Include="appicon.ico" />
124134
</ItemGroup>

Samples/Islands/DrawingIsland/CalculatorDemoPackage/CalculatorDemoPackage.wapproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
7070
<ItemGroup>
7171
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.3233" PrivateAssets="all" />
72+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240428000" />
7273
</ItemGroup>
7374
<ItemGroup>
7475
<ProjectReference Include="..\CalculatorDemo\CalculatorDemo.csproj" />

0 commit comments

Comments
 (0)