Skip to content

Commit dee53ef

Browse files
fix(ci): pass -p:Platform=$hostArch to TestApp build
Scaffolded apps inherit Directory.Build.props: <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained> The SelfContained target rejects AnyCPU (it needs a concrete arch to embed the right runtime), so `dotnet build TestApp` with no `-p:Platform` fails on a fresh clone: Microsoft.WindowsAppSDK.SelfContained.targets(74,9): error : WindowsAppSDKSelfContained requires a supported Windows architecture. Detect $env:PROCESSOR_ARCHITECTURE and pass it through. This is the same wart the user flagged earlier ("we don't want to REQUIRE devs to do self contained") — addressing that properly means changing the default in Directory.Build.props or in the template, which is bigger than this PR's scope. For now, unblock CI. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a55433d commit dee53ef

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

.github/workflows/bootstrap.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,14 @@ jobs:
164164
- name: Build TestApp (default WindowsAppSDKSelfContained=true)
165165
shell: pwsh
166166
run: |
167+
# WindowsAppSDKSelfContained=true (inherited from
168+
# Directory.Build.props) requires a concrete arch to embed the
169+
# runtime under — AnyCPU is rejected by the SelfContained
170+
# target. Pass the host arch explicitly.
171+
$arch = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { 'ARM64' } else { 'x64' }
167172
dotnet build TestProjects/TestApp/TestApp.csproj `
168173
-c Release `
174+
"-p:Platform=$arch" `
169175
--nologo -v:m
170176
if ($LASTEXITCODE -ne 0) { throw "TestApp build exited $LASTEXITCODE" }
171177

0 commit comments

Comments
 (0)