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
385 stars 89 forks source link

WPF Sample app crashes, fails to resolve Microsoft.UI.Xaml.Controls.XamlControlsResources #336

Open ChrisGuzak opened 3 years ago

ChrisGuzak commented 3 years ago

Describe the bug

Sample apps don't run

Steps to Reproduce

Expected behavior

Samples should run.

Environment

Windows 11

Additional context

Failure to resolve Microsoft.UI.Xaml.Controls.XamlControlsResources. here is the error output in the debugger and stack.

Exception thrown at 0x00007FF9B011F55C (KernelBase.dll) in Microsoft.Toolkit.Sample.Wpf.App.exe: WinRT originate error - 0x80131522 : 'System.TypeLoadException: Could not find Windows Runtime type 'Microsoft.UI.Xaml.Controls.XamlControlsResources'.
   at Microsoft.Toolkit.Sample.UWP.App.Microsoft_Toolkit_Sample_UWP_App_XamlTypeInfo.XamlTypeInfoProvider.InitTypeTables()
   at Microsoft.Toolkit.Sample.UWP.App.Microsoft_Toolkit_Sample_UWP_App_XamlTypeInfo.XamlTypeInfoProvider.LookupTypeIndexByName(String typeName) in C:\Users\chrisg\source\repos\ChrisGuzak\Microsoft.Toolkit.Win32\Microsoft.Toolkit.Sample.UWP.App\obj\x64\Debug\XamlTypeInfo.g'.
Unhandled exception at 0x00007FF99E866B20 (Windows.UI.Xaml.dll) in Microsoft.Toolkit.Sample.Wpf.App.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x00000239A77D6ED0, 0x0000000000000005).

stack

>   Windows.UI.Xaml.dll!DirectUI::ErrorHelper::ProcessUnhandledError(DirectUI::ErrorInfo & errorInfo, unsigned int fSkipFailFastIfNoErrorContext, unsigned int * pfHandled) Line 616    C++
    Windows.UI.Xaml.dll!DirectUI::ErrorHelper::ReportUnhandledError(HRESULT hrError) Line 502   C++
    Windows.UI.Xaml.dll!DirectUI::DXamlCore::EnsureCoreApplicationInitialized() Line 695    C++
    Windows.UI.Xaml.dll!DirectUI::FrameworkApplication::StartOnCurrentThreadImpl(Windows::UI::Xaml::IApplicationInitializationCallback * pCallback) Line 84 C++
    Windows.UI.Xaml.dll!DirectUI::FrameworkApplicationGenerated::StartOnCurrentThread(Windows::UI::Xaml::IApplicationInitializationCallback * pCallback) Line 667   C++
    Windows.UI.Xaml.dll!DirectUI::WindowsXamlManager::XamlCore::Initialize() Line 235   C++
    Windows.UI.Xaml.dll!DirectUI::WindowsXamlManager::Initialize() Line 271 C++
    Windows.UI.Xaml.dll!ctl::ComObjectBase::CreateInstanceBase(ctl::ComBase * pNewInstance, unsigned int) Line 52   C++
    Windows.UI.Xaml.dll!ctl::ComObject<DirectUI::WindowsXamlManager>::CreateInstance<DirectUI::WindowsXamlManager>(IInspectable * ppNewInstance, DirectUI::WindowsXamlManager * *) Line 167 C++
    [Inline Frame] Windows.UI.Xaml.dll!ctl::ComObject<DirectUI::WindowsXamlManager>::CreateInstance(DirectUI::WindowsXamlManager * *) Line 159  C++
    Windows.UI.Xaml.dll!ctl::make<DirectUI::WindowsXamlManager>(ctl::Internal::ComPtrRef<ctl::ComPtr<DirectUI::WindowsXamlManager>> ppNewInstance) Line 43  C++
    Windows.UI.Xaml.dll!DirectUI::WindowsXamlManagerFactory::InitializeForCurrentThreadImpl(Windows::UI::Xaml::Hosting::IWindowsXamlManager * * ppReturnValue) Line 196 C++
    Windows.UI.Xaml.dll!DirectUI::WindowsXamlManagerFactory::InitializeForCurrentThread(Windows::UI::Xaml::Hosting::IWindowsXamlManager * * ppResult) Line 92   C++
    Microsoft.Toolkit.Win32.UI.XamlHost.dll!winrt::impl::consume_Windows_UI_Xaml_Hosting_IWindowsXamlManagerStatics<winrt::Windows::UI::Xaml::Hosting::IWindowsXamlManagerStatics>::InitializeForCurrentThread() Line 212   C++
    Microsoft.Toolkit.Win32.UI.XamlHost.dll!<lambda_8446bac442f0034ea1a52904fe32681e>::operator()<winrt::Windows::UI::Xaml::Hosting::IWindowsXamlManagerStatics const &>(const winrt::Windows::UI::Xaml::Hosting::IWindowsXamlManagerStatics & f) Line 957  C++
    Microsoft.Toolkit.Win32.UI.XamlHost.dll!winrt::impl::factory_cache_entry<winrt::Windows::UI::Xaml::Hosting::WindowsXamlManager,winrt::Windows::UI::Xaml::Hosting::IWindowsXamlManagerStatics>::call<<lambda_8446bac442f0034ea1a52904fe32681e> &>(winrt::Windows::UI::Xaml::Hosting::WindowsXamlManager::InitializeForCurrentThread::__l2::<lambda_8446bac442f0034ea1a52904fe32681e> & callback) Line 5452   C++
    Microsoft.Toolkit.Win32.UI.XamlHost.dll!winrt::impl::call_factory<winrt::Windows::UI::Xaml::Hosting::WindowsXamlManager,winrt::Windows::UI::Xaml::Hosting::IWindowsXamlManagerStatics,<lambda_8446bac442f0034ea1a52904fe32681e>>(winrt::Windows::UI::Xaml::Hosting::WindowsXamlManager::InitializeForCurrentThread::__l2::<lambda_8446bac442f0034ea1a52904fe32681e> && callback) Line 5513  C++
    Microsoft.Toolkit.Win32.UI.XamlHost.dll!winrt::Windows::UI::Xaml::Hosting::WindowsXamlManager::InitializeForCurrentThread() Line 957    C++
    Microsoft.Toolkit.Win32.UI.XamlHost.dll!winrt::Microsoft::Toolkit::Win32::UI::XamlHost::implementation::XamlApplication::Initialize() Line 46   C++
    Microsoft.Toolkit.Win32.UI.XamlHost.dll!winrt::impl::produce<winrt::Microsoft::Toolkit::Win32::UI::XamlHost::implementation::XamlApplication,winrt::Microsoft::Toolkit::Win32::UI::XamlHost::IXamlApplicationProtected>::Initialize() Line 89   C++
    [Managed to Native Transition]  
    Microsoft.Toolkit.Sample.UWP.App.exe!Microsoft.Toolkit.Sample.UWP.App.App.App() Line 25 C#
ghost commented 3 years ago

Hello ChrisGuzak, 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.

ChrisGuzak commented 3 years ago

@michael-hawker is this something you can help me with? @asklar, FYI

michael-hawker commented 3 years ago

@ChrisGuzak we need @marb2000 or @ocalvo to take a look at this.