Net7 Maui Unable to load DLL 'Microsoft.ui.xaml.dll'

Shermak, Carl (C.E.) 20 Reputation points
2023-03-24T12:51:21.5833333+00:00

In Visual Studio, using Net7, when debugging project it runs fine. If I go to the directory and run the exe I get the following message in application log "Exception Info: System.DllNotFoundException: Unable to load DLL 'Microsoft.ui.xaml.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)". When researching the problem it seems to be common issue but none of the solutions work.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,342 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,838 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 25,841 Reputation points Microsoft Vendor
    2023-03-30T04:05:25.2566667+00:00

    Hello,

    Right now, it's not supported run the exe file in bin folder directly, you may can run the exe with WPF or other projects but not with MAUI/WinUI projects. Please refer to this doc- Debugging on Windows - .NET MAUI | Microsoft Learn to debug your app.

    Besides, running exe's in MAIX packages is also not supported. It's only supported publishing to an MSIX and running it that way.

    Best Regards,

    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments