microsoft / microsoft/microsoft-ui-xaml
Report better errors when a library doesn't support AoT
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
This is a follow up to https://github.com/microsoft/microsoft-ui-xaml/issues/9980
If you reference a library that hasn't done the work to upgrade to WinAppSDK 1.6, upgraded CSWinRT and generated the new projections, what you're met with is this obscure error on launch:

There's no way to identify what is causing this crash. If we could have a build error/warning when PublishAoT is enabled, or a better exception at runtime that lets us identify which dependency doesn't support AoT, so that we can contact the library authors and have them address it.
### Steps to reproduce the bug
1. Create a new WinUI3 project and enabled it for AoT
2. Reference WinUIEx v2.4.0
3. Run the app.
4. Boom!
### Expected behavior
_No response_
### Screenshots
_No response_
### NuGet package version
WinUI 3 - Windows App SDK 1.6.0: 1.6.240829007
### Windows version
Windows 11 (22H2): Build 22621
### Additional context
_No response_
Contributor guide
Research direction
Start with the WinAppSDK 1.6 PublishAoT reproduction using a new WinUI3 project and WinUIEx v2.4.0. Compare the current launch failure with the requested build warning or runtime exception, and consider the work complete when the unsupported dependency can be identified from the resulting diagnostic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, csharp
- Domain
- build-system, desktop
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100