microsoft / Xaml-Islands-Samples

MIT License
101 stars 44 forks source link

Samples crash on launch #46

Open kmelmon opened 3 years ago

kmelmon commented 3 years ago

Some recent change is causing all the samples to crash on launch. Currently, I suspect an update to Visual Studio is the reason as there haven't been code changes that explain this issue.

Repro Steps: -Open any of the sample solutions and build Debug/x86 -Launch the app on local dev box Result: Crash with dialog box that says: Debug Error! Program abort() has been called (Press Retry to debug the application)

TBD: Analyze the actual failure, looks like we fail to activate one of the main XAML objects with failure HRESULT coming back

MattBDev commented 2 years ago

I am getting the exact issue. Trying to run the Win32 or MFC solutions results in the abort() has been called error.

Code-ScottLe commented 2 years ago

I am running into the same problem if trying to package the win32 app using MSIX based on this section in the doc. Can anybody here take a look?

Code-ScottLe commented 2 years ago

Be advised, if you downgrade the Microsoft.Toolkit.Win32.UI.SDK inside the sample to anything <= 6.0.0-preview7.1, things started to work (for me at least).

alex-aparin commented 2 years ago

Compilation is too long (it takes about 15-20 min). Generated source files cause this. Also application is crashed (I tried to both x86/x64 platforms).

MattBDev commented 2 years ago

I wish Microsoft would at least try to look at this issue. People are willing to use XAML Islands to modernize their applications but it is useful to have examples to look at.

MattBDev commented 2 years ago

The problem seems to be specifically with trying to run the packaged version of the Samples. Having them packaged with MSIX seems to cause the crash. I was able to run the app unpackaged successfully.

HO-COOH commented 1 year ago

How can this issue still got no response after 2 years?

Blinue commented 6 months ago

Found the solution. Adding the following between line 82 and 83 of SampleCppApp.Package.wapproj resolves this issue:

<ProjectReference Include="..\..\Native\MyApp\MyApp.vcxproj" />

Reference: https://github.com/CommunityToolkit/Microsoft.Toolkit.Win32/issues/340