MissingMetadataException with .NET Native on 19041
See original GitHub issueDescribe the bug
I’ve recently updated to Windows 10 19041.264
, and apparently many .NET Native builds are just flat out broken for me. This includes both the Windows Community Toolkit Sample app (straight from master
, cc. @michael-hawker) as well as my own app Legere (cc. @LanceMcCarthy, since you helped me pinpoint the previous issue in #1286). Some info I managed to gather:
- The .NET Native runs fine, but the app crashes at startup.
- I can’t repro this with a blank UWP app
- I can repro this both in the Windows Community Toolkit Sample App and in my own app, but the crashes happen with two different types. Specifically,
Windows.Foundation.IReference<double>
in the sample app, andSCG.IList<WCT.Uwp.UI.Media.Effects.IPipelineEffect>
in my app. - My app has this crash when I build it with .NET Native on my PC, but if i create a Store package without .NET Native and let the Store build it with .NET Native remotely, then the app package I install from the Store works just fine. I suspect this might be because the Store is using some VMs that have a previous Windows 10 build than
19041
? 🤷♂️
Important question
Related to this last point, assuming this is the case, I fear that if the W10 VM the Store uses to build the apps with .NET Native gets updated to one with W10 19041, the Store could just recompile the app again (it does so occasionally) and just push that update to all my users, which would then completely trash my app, since on my device it just crashes at startup with the .NET Native build done on W10 19041. Is this fear justified? Is there anything I can do regarding this?
cc. @MichalStrehovsky and @MattWhilden as the two .NET Native experts here 😄
Steps to reproduce the bug
Steps to reproduce the behavior:
- Clone the Windows Community Toolkit repo (here), switch to
master
(ae4000bcc6cd8eb235b9915a811bd5ea1097169a
at the moment). - Run the Sample App in Debug x64, observe it works just fine
- Right click on the Sample App project > Build > tick “.NET Native toolchain”
- Rebuild and run
- Observe the crash with that metadata exception (and others as well if you click continue)
Expected behavior
The app should work just fine.
Screenshots
Version Info
NuGet package version:
Microsoft.UI.Xaml 2.4.2
Windows 10 version | Saw the problem? |
---|---|
Insider Build (19041.264) | Yes |
November 2019 Update (18363) | |
May 2019 Update (18362) | |
October 2018 Update (17763) | |
April 2018 Update (17134) | |
Fall Creators Update (16299) | |
Creators Update (15063) |
Device form factor | Saw the problem? |
---|---|
Desktop | Yes |
Mobile | |
Xbox | |
Surface Hub | |
IoT |
Additional context
Just as a test, I tried to checkout my app to a commit from 4+ months ago. I got the same exact crash in the same exact spot, just with a different type (I wasn’t using the .Media
package from the toolkit at that time since it didn’t exist yet). When I was on 18363
, I could build and run the app just fine with .NET Native, except for that other issue mentioned already in #1286.
Note that the current version of my app targets the 19041 SDK, while the version from 4+ months ago targets the 18362 SDK. Both crash with the same exact error, as mentioned above.
@LanceMcCarthy since you’re already familiar with my repo (Legere) as you helped me debug that issue the other time, if you’re on 19041
too would you mind if I gave you access to it again to try to see if you can repro the same crash on your end as well?
Just to double check and hopefully gather some more info.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:32 (15 by maintainers)
Top GitHub Comments
@Sergio0694 ILCRepros are still quite helpful for app crashes. Being able to rebuild the package and run it lets us help test theories and fixes for runtime issues. 😊
@Sergio0694 Thanks, I’ve cloned it and am working on preparing the repro now. I’ll open an issue in the repo for any private-project related stuff.
To comment on to your statement about how it work with a Debug .NET Native build, that’s still fundamentally different than a Release build. Do a release build and side-load/appinstaller load, I think the same crash should occur.