WindowsAppSDK: .NET MAUI app crashes (unless run as administrator)

I was testing Microsoft.WindowsAppSDK 1.2.221116.1, and the app crashes with an odd message in the output window:

'MauiApp42.exe' (Win32): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\MauiApp42.exe'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\msvcp_win.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\hostfxr.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\hostpolicy.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\coreclr.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\oleaut32.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\bcryptprimitives.dll'. Symbols loaded.
The thread 0xf24 has exited with code 0 (0x0).
'MauiApp42.exe' (Win32): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Private.CoreLib.dll'. 
'MauiApp42.exe' (Win32): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\clrjit.dll'. Symbols loaded.
'MauiApp42.exe' (CoreCLR: DefaultDomain): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Private.CoreLib.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\MauiApp42.dll'. 
'MauiApp42.exe' (Win32): Unloaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\MauiApp42.dll'
'MauiApp42.exe' (Win32): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\MauiApp42.dll'. 
The thread 0xc7ec has exited with code 0 (0x0).
'MauiApp42.exe' (CoreCLR: clrhost): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\MauiApp42.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Runtime.dll'. 
'MauiApp42.exe' (CoreCLR: clrhost): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Runtime.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\uxtheme.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\icu.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Projection.dll'. 
'MauiApp42.exe' (CoreCLR: clrhost): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Projection.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Runtime.InteropServices.dll'. 
'MauiApp42.exe' (CoreCLR: clrhost): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Runtime.InteropServices.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\WinRT.Runtime.dll'. 
'MauiApp42.exe' (CoreCLR: clrhost): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\WinRT.Runtime.dll'. 
'MauiApp42.exe' (Win32): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Collections.Concurrent.dll'. 
'MauiApp42.exe' (CoreCLR: clrhost): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Collections.Concurrent.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Collections.dll'. 
'MauiApp42.exe' (CoreCLR: clrhost): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Collections.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Threading.dll'. 
'MauiApp42.exe' (CoreCLR: clrhost): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Threading.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\bcrypt.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Runtime.CompilerServices.Unsafe.dll'. 
'MauiApp42.exe' (CoreCLR: clrhost): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Runtime.CompilerServices.Unsafe.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\clbcatq.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\Windows.StateRepositoryCore.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.2_2000.684.1510.0_x64__8wekyb3d8bbwe\Microsoft.WindowsAppRuntime.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\userenv.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\powrprof.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\xmllite.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\WinTypes.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\rometadata.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\umpdc.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.2_2000.684.1510.0_x64__8wekyb3d8bbwe\Microsoft.WindowsAppRuntime.Insights.Resource.dll'. 
D:\a\_work\1\s\dev\WindowsAppRuntime_Insights\WindowsAppRuntimeInsights.h(44)\Microsoft.WindowsAppRuntime.dll!00007FF8EECC8C21: (caller: 00007FF8EECC8B4C) LogHr(1) tid(719c) 8007029C An assertion failure has occurred.
D:\a\_work\1\s\dev\WindowsAppRuntime_Insights\WindowsAppRuntimeInsights.h(44)\Microsoft.WindowsAppRuntime.dll!00007FF8EECC8C21: (caller: 00007FF8EECC8B4C) LogHr(2) tid(719c) 8007029C An assertion failure has occurred.
    Msg:[Failed to load resource string. id: 10001] 
D:\a\_work\1\s\dev\Deployment\DeploymentManager.cpp(333)\Microsoft.WindowsAppRuntime.dll!00007FF8EED2E350: (caller: 00007FF8EED2D57E) ReturnHr(1) tid(719c) 80070490 Element not found.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\Clipc.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\cryptsp.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Unloaded 'C:\Windows\System32\cryptsp.dll'
'MauiApp42.exe' (Win32): Unloaded 'C:\Windows\System32\Clipc.dll'
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\daxexec.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\SHCore.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\fltLib.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\profapi.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\windows.storage.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\container.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\AppXDeploymentClient.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\IPHLPAPI.DLL'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\wldp.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Windows\System32\ntmarta.dll'. Symbols loaded.
D:\a\_work\1\s\dev\Deployment\DeploymentManager.cpp(454)\Microsoft.WindowsAppRuntime.dll!00007FF8EED2EEBE: (caller: 00007FF8EED2FAFB) ReturnHr(2) tid(719c) 80070005 Access is denied.
    Msg:[DeploymentAgent exitcode:0x80070005] 
D:\a\_work\1\s\dev\Deployment\DeploymentManager.cpp(551)\Microsoft.WindowsAppRuntime.dll!00007FF8EED2FBCB: (caller: 00007FF8EED2F164) ReturnHr(3) tid(719c) 80070005 Access is denied.
D:\a\_work\1\s\dev\Deployment\DeploymentManager.cpp(463)\Microsoft.WindowsAppRuntime.dll!00007FF8EED2F183: (caller: 00007FF8EED2DD7C) ReturnHr(4) tid(719c) 80070005 Access is denied.
'MauiApp42.exe' (Win32): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Private.Uri.dll'. 
'MauiApp42.exe' (CoreCLR: clrhost): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Private.Uri.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.ObjectModel.dll'. 
'MauiApp42.exe' (CoreCLR: clrhost): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.ObjectModel.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.ComponentModel.dll'. 
'MauiApp42.exe' (CoreCLR: clrhost): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.ComponentModel.dll'. Symbols loaded.
'MauiApp42.exe' (Win32): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Numerics.Vectors.dll'. 
'MauiApp42.exe' (CoreCLR: clrhost): Loaded 'C:\Users\jopepper\source\repos\MauiApp42\MauiApp42\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Numerics.Vectors.dll'. Symbols loaded.
The thread 0x7c74 has exited with code 2147942405 (0x80070005).
The thread 0x99bc has exited with code 2147942405 (0x80070005).
The thread 0xd630 has exited with code 2147942405 (0x80070005).
The thread 0xabfc has exited with code 2147942405 (0x80070005).
The thread 0xdb48 has exited with code 2147942405 (0x80070005).
The thread 0xfab8 has exited with code 2147942405 (0x80070005).
The thread 0x9324 has exited with code 2147942405 (0x80070005).
The thread 0xa0c0 has exited with code 2147942405 (0x80070005).
The thread 0x640c has exited with code 2147942405 (0x80070005).
The thread 0x6960 has exited with code 2147942405 (0x80070005).
The program '[34848] MauiApp42.exe' has exited with code 2147942405 (0x80070005).

I tried disabling Just My Code and added "nativeDebugging": true to the launch profile, but I can’t seem to get more information.

If I “run as administor” on the app once, it starts working:

image

To get back to a state where it is crashing, I can follow:

https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/remove-windows-app-sdk-versions#remove-windows-app-sdk-runtime-components-using-powershell

I tried to get a .dmp file of this crash, but the app does not seem to write anything to %LOCALAPPDATA%\CrashDumps.

I think I am running the latest Windows 10:

image

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (4 by maintainers)

Most upvoted comments

For me the problem is gone after installing the latest Windows App SDK 1.2 from

https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/downloads#windows-app-sdk-12

I will not comment that this kind of magic solution was not part of old and good Visual Studio.

Windows 10, Net 7.0  MAUI Blazor project, VS Pro 2022 17.4.3

Had the same problem, even with fresh new projects. For me, the issue was the version of .NET. It does it with .NET 7.0 and works fine with .NET 6.0