At the end of the Create a Package section, you must set that project as the startup project (right click on the project and select "Set as StartUp Project"). That way when you F5 you're running the packaged app. Otherwise, when you run the app you're getting the unpackaged WPF or WinForms app, and you get an exception like:
'The invocation of the constructor on type 'Microsoft.Toolkit.Wpf.UI.XamlHost.WindowsXamlHost' that matches the specified binding constraints threw an exception.'
And/or
Catastrophic failure. WindowsXamlManager and DesktopWindowXamlSource are supported for apps targeting Windows version 10.0.18226.0 and later. Please check either the application manifest or package manifest and ensure the MaxTestedVersion property is updated.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: 25545d7e-3f94-e1dd-e9cc-eabe0c067d37
Version Independent ID: 750a070c-e68a-2a5d-134d-9888dc1ed5fa
At the end of the Create a Package section, you must set that project as the startup project (right click on the project and select "Set as StartUp Project"). That way when you F5 you're running the packaged app. Otherwise, when you run the app you're getting the unpackaged WPF or WinForms app, and you get an exception like:
And/or
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.