MiZa
MiZa

Reputation: 31

WinUI - Unable to load DLL 'Microsoft.ui.xaml.dll'

used uno-check to install all the needed prerequisites.

after this i have installed the Uno Platform dotnet templates :

dotnet new -i Uno.ProjectTemplates.Dotnet

and created a new project with this command :

dotnet new unoapp-winui -o MyUnoApp

who give me some errors about failed restoration (MSBUILD : error MSB1009 - project file not exist -)

After that i load the solution in visual studio (2019/2022), select MyUnoApp.Windows.Desktop as starting project (x86) and start the debug session but i got this error:

An unhandled exception of type 'System.DllNotFoundException' occurred in UNO.Windows.Desktop.dll Unable to load DLL 'Microsoft.ui.xaml.dll' or one of its dependencies

Any hint?

Upvotes: 3

Views: 3124

Answers (2)

Dierk Droth
Dierk Droth

Reputation: 59

It's my understanding that MyUnoApp.Windows.Desktop is the building target for the Windows desktop, whereas MyUnoApp.Windows.Package is the building target for the UWP app (pls correct me if I'm wrong). Hence, the original poster still would not have the problem of being unable to build the desktop app - which is the same problem I'm facing right now.

Upvotes: 0

JohanO
JohanO

Reputation: 86

I had the exact same problem, but after fiddling around a bit I found a solution.
Set the '.Windows.Package' project as startup instead of '.Windows.Desktop'

Also make sure you are have the same Platform selected for both Package and Desktop project.

enter image description here

Upvotes: 5

Related Questions