question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question :`Microsoft.ui.xaml.dll` is unable to load

See original GitHub issue

I am getting an exception in my WinUI3 app that Microsoft.ui.xaml.dll is unable to load. I have included Microsoft.UI.Xaml and Microsoft.Graphics.Win2D in nuget.

System.DllNotFoundException
  HResult=0x80131524
  Message=Unable to load DLL 'Microsoft.ui.xaml.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)
  Source=TibraUI
  StackTrace:
   at TibraUI.Program.XamlCheckProcessRequirements()
   at TibraUI.Program.Main(String[] args) in C:\Users\Bryan\src\tibra\Tibra\TibraUI\obj\x64\Debug\net6.0-windows10.0.19041.0\win10-x64\App.g.i.cs:line 28

Windows Version 21H1 Build 19043.1348

My App.xaml

<Application
    x:Class="TibraUI.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:TibraUI">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
                <!-- Other merged dictionaries here -->
            </ResourceDictionary.MergedDictionaries>
            <!-- Other app resources here -->
        </ResourceDictionary>
    </Application.Resources>
</Application>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
runceelcommented, Jan 9, 2022

I faced same issue. In my case, root cause was launchSettings.json.

When I had faced this issue the file was:

{
  "profiles": {
    "Project Name": {
      "commandName": "Project"
    },
    "WSL": {
      "commandName": "WSL2",
      "environmentVariables": {},
      "distributionName": ""
    }
  }
}

I changed the file to fix this issue to:

{
  "profiles": {
    "Project Name (Package)": {
      "commandName": "MsixPackage"
    },
    "Project Name (Unpackaged)": {
      "commandName": "Project"
    }
  }
}

launchSettings.json was ignored by .gitignore. I cloned my WinUI 3.0 project from a git repository. Then Visual Studio generated default launchSettings.json. It didn’t work for WinUI 3.0 project. So I had to change it myself to fix this error.

0reactions
msftbot[bot]commented, Oct 26, 2022

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to load DLL 'Microsoft.ui.xaml.dll' or one of its ...
Unable to load DLL 'Microsoft.ui.xaml.dll' or one of its dependencies: Access is denied ... I am trying to get a WinUI3 app to...
Read more >
.NET 6 and WINUI3 fails to start Unable to load DLL ...
DllNotFoundException: Unable to load DLL 'Microsoft.ui.xaml.dll' or one of its dependencies: The specified module could not be found.
Read more >
Net7 Maui Unable to load DLL 'Microsoft.ui.xaml.dll'
In Visual Studio, using Net7, when debugging project it runs fine. If I go to the directory and run the exe I get...
Read more >
`Microsoft.ui.xaml.dll` is unable to load - visual studio
I am getting an exception in my WinUI3 app that Microsoft.ui.xaml.dll is unable to load. I have included Microsoft.UI.Xaml and Microsoft.
Read more >
WinUI3 application crashing | Microsoft.ui.xaml.dll no found
Unable to load DLL 'Microsoft.ui.xaml.dll' or one of its dependencies: The specified module could not be found. (0x8007007E).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found