Hi @Hong
Thank you for providing the additional information, call stack, and clarification about the use of ToList().
The available evidence does not yet confirm that ObservableCollection itself is the root cause. The exception is a native access violation followed by a fail-fast in Microsoft.UI.Xaml, while the supplied call stack contains only unresolved native addresses.
However, I tested the shared App1 project and found the following workaround while keeping the original ObservableCollection code unchanged.
I added these properties to the project file:
<PropertyGroup>
<WindowsPackageType>None</WindowsPackageType>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<EnableMsixTooling>true</EnableMsixTooling>
<PublishTrimmed>false</PublishTrimmed>
</PropertyGroup>
I then deleted the existing bin and obj directories and generated a fresh Release x64 publish. With this configuration, the application remained open and responsive, and the ListView displayed the original ObservableCollection without converting it to a List.
Disabling PublishTrimmed alone did not resolve the issue in my test. Adding only the Windows App SDK deployment properties also did not resolve it. The application worked when both changes were applied together.
Microsoft documents that .NET self-contained deployment and Windows App SDK self-contained deployment require separate configuration:
Windows App SDK deployment guide for self-contained apps
A similar published WinUI failure with exception code 0xC000027B was resolved using these Windows App SDK deployment properties:
WinUI 3 published unpackaged self-contained app crashes immediately
Please note that WindowsPackageType=None applies to the unpackaged App1 project you shared. I suggest testing this workaround in the same minimal project first. The Microsoft Store project's packaged configuration should be reviewed separately before applying this property to production.
Please let me know whether the newly published App1 build works with this combined configuration.
If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation.
Thank you.