Skip to content

Commit 1fca91e

Browse files
authored
fix(build): disable assembly trimming to fix release crashes (#37)
WinUI 3 applications crash when assembly trimming is enabled because XAML deserialization relies on dynamic type instantiation and metadata that gets stripped by the trimmer. This caused STATUS_STOWED_EXCEPTION (0xc000027b) crashes in Microsoft.UI.Xaml.dll when running the portable release build. Changes: - Remove PublishTrimmed from release workflow - Set PublishTrimmed=false in publish profiles - Remove unnecessary trim warning suppression settings Fixes #35
1 parent 5cad081 commit 1fca91e

File tree

4 files changed

+2
-8
lines changed

4 files changed

+2
-8
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ jobs:
5858
--self-contained true `
5959
-p:PublishSingleFile=false `
6060
-p:PublishReadyToRun=true `
61-
-p:PublishTrimmed=true `
6261
-p:Platform=${{ matrix.platform }} `
6362
--output ./artifacts/portable/${{ matrix.platform }}
6463

Directory.Build.props

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,5 @@
44
<Nullable>enable</Nullable>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
7-
<!-- Suppress known Windows SDK trim warnings -->
8-
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
9-
<TrimmerSingleWarn>false</TrimmerSingleWarn>
107
</PropertyGroup>
118
</Project>

src/CodingWithCalvin.VSToolbox/Properties/PublishProfiles/win-arm64.pubxml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
1313
<PublishSingleFile>False</PublishSingleFile>
1414
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
1515
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
16-
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
17-
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
16+
<PublishTrimmed>false</PublishTrimmed>
1817
</PropertyGroup>
1918
</Project>

src/CodingWithCalvin.VSToolbox/Properties/PublishProfiles/win-x64.pubxml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
1313
<PublishSingleFile>False</PublishSingleFile>
1414
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
1515
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
16-
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
17-
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
16+
<PublishTrimmed>false</PublishTrimmed>
1817
</PropertyGroup>
1918
</Project>

0 commit comments

Comments
 (0)