adospace / reactorui-maui

MauiReactor is a MVU UI framework built on top of .NET MAUI
MIT License
586 stars 49 forks source link

dotnet build -t:Run -f net7.0-windows10.0.19041 throws System.DllNotFoundException #76

Closed Dimension4 closed 1 year ago

Dimension4 commented 1 year ago

I've tried to follow the setup steps in the readme, but it doesn't seem to work if I target Windows. Here's the output for the MauiReactor.TestApp project:

> dotnet build -t:Run -f net7.0-windows10.0.19041
MSBuild version 17.5.1+f6fdcf537 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  Unhandled exception. System.DllNotFoundException: Unable to load DLL 'Microsoft.ui.xaml.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)
     at MauiReactor.TestApp.WinUI.Program.XamlCheckProcessRequirements()
     at MauiReactor.TestApp.WinUI.Program.Main(String[] args) in C:\code\reactorui-maui\samples\MauiReactor.TestApp\obj\Debug\net7.0-windows10.0.19041\win10-x64\Platforms\Windows\App.g.i.cs:line 28
C:\Program Files\dotnet\sdk\7.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(927,5): error MSB3073: The command "C:\code\reactorui-maui\samples\MauiReactor.TestApp\bin\Debug\net7.0-windows10.0.19041\win10-x64\MauiReactor.TestApp.exe " exited with code -5
32462766. [C:\code\reactorui-maui\samples\MauiReactor.TestApp\MauiReactor.TestApp.csproj::TargetFramework=net7.0-windows10.0.19041]

Build FAILED.

C:\Program Files\dotnet\sdk\7.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(927,5): error MSB3073: The command "C:\code\reactorui-maui\samples\MauiReactor.TestApp\bin\Debug\net7.0-windows10.0.19041\win10-x64\MauiReactor.TestApp.exe " exited with code -5
32462766. [C:\code\reactorui-maui\samples\MauiReactor.TestApp\MauiReactor.TestApp.csproj::TargetFramework=net7.0-windows10.0.19041]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.85

F5 debugging in Visual Studio works though. I assume this is because the project is configured to also deploy on build (in the Configuration Manager).

Reactor.Maui version is 1.0.124.

adospace commented 1 year ago

In my experience, I found that dotnet build has many problems in building maui applications targeting Windows.

Can you make a test trying to build a brand-new maui standard application from cli with the same command? does it work?

Dimension4 commented 1 year ago

You're right. Even the default maui template has the exact same issue. I guess this is a maui or WinUI problem then. Thanks for looking into it though.