Skip to content

Unable to run Windows application from command line #5975

@eerhardt

Description

@eerhardt

Description

I am unable to launch my Maui Windows application from the command line. With Android I can with dotnet build -t:Run. But this doesn't work with Windows. Note that dotnet run -f net6.0-windows10.0.19041.0 also doesn't work.

cc @mattleibow

Steps to Reproduce

  1. dotnet new maui
  2. dotnet build -t:Run -f net6.0-windows10.0.19041.0

Results

C:\git\maui\bin\dotnet\sdk\6.0.300-preview.22207.16\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(901,5): er
ror MSB3073: The command "C:\DotNetTest\MauiTest\bin\Debug\net6.0-windows10.0.19041.0\win10-x64\MauiTest.exe " exited w
ith code -532462766. [C:\DotNetTest\MauiTest\MauiTest.csproj]

Version with bug

Unknown/Other (please specify)

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

All Windows

Did you find any workaround?

No response

Relevant log output

When attaching a Debugger to the process, I see:

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=MauiTest
  StackTrace:
   at MauiTest.WinUI.Program.XamlCheckProcessRequirements()
   at MauiTest.WinUI.Program.Main(String[] args) in C:\DotNetTest\MauiTest\obj\Debug\net6.0-windows10.0.19041.0\win10-x64\Platforms\Windows\App.g.i.cs:line 28

Depends on

Metadata

Metadata

Labels

area-publishingIssues with the app packaging/publishing process (ipk/apk/msix/trimming)area-toolingXAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, DebuggingblockedWork that is currently blockedexternalplatform/windowss/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingt/desktopThe issue relates to desktop scenarios (MacOS/MacCatalyst/Windows/WinUI/WinAppSDK)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions