2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

WinUI 3 空のテンプレートで、Release ビルドで例外

Last updated at Posted at 2024-08-20

2024-8-20 時点

いずれ解決されるでしょうが、日本語で解説がないのでメモしておきます。

20240820 101743 MicrosoftVisualStudio.png

WinUI 3の、テンプレートで、空のアプリ、パッケージ化(デスクトップのWinUI 3)から、プロジェクトを作成します。

20240820 102550 Anonymous.png

Releaseでビルドします。

すると、
「ハンドルされていない、Win32の例外が発生しました。」
「デバッガーが にアタッチされていますが、このハンドルされない例外をデバッグするように構成されていません。」
20240820 102244 Just-In-Timeデバッガーを選択する.png

これでは、どこで例外が発生しているのか分からないので、

20240820 102307 App4-MicrosoftVisualStudio.png

「ネイティブコードのデバッグを有効にする」
にします。

すると、例外は、次で発生していることがわかります。

20240820 102335 App4(デバッグ中)-MicrosoftVisualStudio.png

現時点での解決方法は、次を変更します。
20240820 102437 App4-MicrosoftVisualStudio.png

<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">False</PublishTrimmed>

PublishTrimmedを、Falseにしますが、本来はTrueにしておくプロパティのはずです。
そのため、問題が解決したら、元のTrueに戻さないといけないと思われます。

環境

  • Microsoft Visual Studio Community 2022 Version 17.11.0

参考

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?