Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.
This repository was archived by the owner on Aug 30, 2023. It is now read-only.

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

Open

Description

@ChrisGuzak

Describe the bug

Sample apps don't run

Steps to Reproduce

  • Cloned the repo Microsoft.Toolkit.Win32
  • Build the toolkit.
  • Select "Microsoft.Toolkit.Sample.Wpf.App" as startup project.
  • Hit F5 to debug

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#

Activity

  1. changed the title [-]WPF Sample app crashes, fails to resolve Failure to resolve `Microsoft.UI.Xaml.Controls.XamlControlsResources`[/-] [+]WPF Sample app crashes, fails to resolve Failure to resolve Microsoft.UI.Xaml.Controls.XamlControlsResources[/+] on Nov 10, 2021
  2. changed the title [-]WPF Sample app crashes, fails to resolve Failure to resolve Microsoft.UI.Xaml.Controls.XamlControlsResources[/-] [+]WPF Sample app crashes, fails to resolve Microsoft.UI.Xaml.Controls.XamlControlsResources[/+] on Nov 10, 2021
  3. ChrisGuzak commented on Nov 30, 2021

    @ChrisGuzak
    Author

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

  4. michael-hawker commented on Nov 30, 2021

    @michael-hawker
    Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions