CommunityToolkit / Microsoft.Toolkit.Win32

ARCHIVE - This repository contained XAML Islands wrapper controls and tooling for XAML Islands with WinUI 2, see readme for more info about XAML Islands with WinUI 3 and the WindowsAppSDK.
https://aka.ms/windowsappsdk
Other
384 stars 89 forks source link

Windows version too new for Forms.UI.XamlHost #310

Open ScruffR opened 3 years ago

ScruffR commented 3 years ago

Describe the bug

I get this exception thrown when I try to create an instance of Microsoft.Toolkit.Forms.UI.XamlHost

System.Exception
  HResult=0x8000FFFF
  Message=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.
  Source=<Cannot evaluate the exception source>
  StackTrace:
<Cannot evaluate the exception stack trace>

Steps to Reproduce

Steps to reproduce the behavior:

  1. Create a new .NET Core 3.1 Forms App
  2. Install packages
  3. Create a private Microsoft.Toolkit.Forms.UI.XamlHost.WindowsXamlHost xamlHost;
  4. Add this.xamlHost = new Microsoft.Toolkit.Forms.UI.XamlHost.WindowsXamlHost(); to InitializeComponents()
  5. run

Expected behavior

Shouldn't crash

Environment


NuGet Package(s): 

Package Version(s): 
![image](https://user-images.githubusercontent.com/6604878/109241639-f495d200-77d9-11eb-90ec-c1713d6ca0ec.png)

Project .NET Version:
- [X] .NET Core 3.1 

Windows 10 Build Number:
- [X] 20H2 Update (19042.844)

App min and target version:
- [X] May 2019 Update (18362)

Device form factor:
- [X] Surface Pro 7

Visual Studio 
- [X] 2019 (version: 16.8.6) 
- [X] 2019 Preview (version: 16.9.0 Preview 5.0)
ghost commented 3 years ago

Hello ScruffR, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

ghost commented 3 years ago

This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established.

dcwork commented 3 years ago

@ScruffR Did you create an app.manifest in your WinForms app similar to what is shown in this post?

michael-hawker commented 3 years ago

FYI @marb2000