MAUI apps crash on launch on Windows after Visual Studio update - code 2147942405 (0x80070005)

See original GitHub issue

UPDATE: Jan 20, 2023 (Link to Comment)

Description

All apps stopped working on Windows after updating Visual Studio to the version 17.4.3 (which probably also updated MAUI). When I press F5, any app will not run and the following error message is displayed in the Output windows:

The program '[8104] MauiBugCrashOnLaunchOnWindows.exe' has exited with code 2147942405 (0x80070005).

The usual steps such as deleting bin and obj folders do not help. This affects all projects. Even an empty project created by Visual Studio template does not run.

Everything worked well with the previous version of VS/MAUI (I think it was MAUI 7.0.49 and VS 17.4.2).

Steps to Reproduce

  1. Create a File > New .NET MAUI App
  2. Run it on Windows (F5)
  3. The app will not run and error message is displayed in the Output window

… I can see that the issue cannot be saved without a link to a repro project. Because any project can be used to reproduce the issue I have added a link to a repro project for another issue to save time. This bug can be reproduced on it but as I have said before, it crashes even on an blank new project.

Link to public reproduction project repository

https://github.com/holecekp/MauiBugToolbar

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows 21H2

Did you find any workaround?

https://github.com/dotnet/maui/issues/12080#issuecomment-1377243186 OR https://github.com/dotnet/maui/issues/12080#issuecomment-1351322492 OR https://github.com/dotnet/maui/issues/12080#issuecomment-1351671363

Relevant log output

'MauiBugCrashOnLaunchOnWindows.exe' (CoreCLR: DefaultDomain): Loaded 'D:\dotNET\MauiBugCrashOnLaunchOnWindows\MauiBugCrashOnLaunchOnWindows\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Private.CoreLib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'MauiBugCrashOnLaunchOnWindows.exe' (CoreCLR: clrhost): Loaded 'D:\dotNET\MauiBugCrashOnLaunchOnWindows\MauiBugCrashOnLaunchOnWindows\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\MauiBugCrashOnLaunchOnWindows.dll'. Symbols loaded.
'MauiBugCrashOnLaunchOnWindows.exe' (CoreCLR: clrhost): Loaded 'D:\dotNET\MauiBugCrashOnLaunchOnWindows\MauiBugCrashOnLaunchOnWindows\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'MauiBugCrashOnLaunchOnWindows.exe' (CoreCLR: clrhost): Loaded 'D:\dotNET\MauiBugCrashOnLaunchOnWindows\MauiBugCrashOnLaunchOnWindows\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Projection.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'MauiBugCrashOnLaunchOnWindows.exe' (CoreCLR: clrhost): Loaded 'D:\dotNET\MauiBugCrashOnLaunchOnWindows\MauiBugCrashOnLaunchOnWindows\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Runtime.InteropServices.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'MauiBugCrashOnLaunchOnWindows.exe' (CoreCLR: clrhost): Loaded 'D:\dotNET\MauiBugCrashOnLaunchOnWindows\MauiBugCrashOnLaunchOnWindows\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\WinRT.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'MauiBugCrashOnLaunchOnWindows.exe' (CoreCLR: clrhost): Loaded 'D:\dotNET\MauiBugCrashOnLaunchOnWindows\MauiBugCrashOnLaunchOnWindows\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Collections.Concurrent.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'MauiBugCrashOnLaunchOnWindows.exe' (CoreCLR: clrhost): Loaded 'D:\dotNET\MauiBugCrashOnLaunchOnWindows\MauiBugCrashOnLaunchOnWindows\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Collections.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'MauiBugCrashOnLaunchOnWindows.exe' (CoreCLR: clrhost): Loaded 'D:\dotNET\MauiBugCrashOnLaunchOnWindows\MauiBugCrashOnLaunchOnWindows\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Threading.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'MauiBugCrashOnLaunchOnWindows.exe' (CoreCLR: clrhost): Loaded 'D:\dotNET\MauiBugCrashOnLaunchOnWindows\MauiBugCrashOnLaunchOnWindows\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Runtime.CompilerServices.Unsafe.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'MauiBugCrashOnLaunchOnWindows.exe' (CoreCLR: clrhost): Loaded 'D:\dotNET\MauiBugCrashOnLaunchOnWindows\MauiBugCrashOnLaunchOnWindows\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Private.Uri.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'MauiBugCrashOnLaunchOnWindows.exe' (CoreCLR: clrhost): Loaded 'D:\dotNET\MauiBugCrashOnLaunchOnWindows\MauiBugCrashOnLaunchOnWindows\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.ObjectModel.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'MauiBugCrashOnLaunchOnWindows.exe' (CoreCLR: clrhost): Loaded 'D:\dotNET\MauiBugCrashOnLaunchOnWindows\MauiBugCrashOnLaunchOnWindows\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.ComponentModel.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'MauiBugCrashOnLaunchOnWindows.exe' (CoreCLR: clrhost): Loaded 'D:\dotNET\MauiBugCrashOnLaunchOnWindows\MauiBugCrashOnLaunchOnWindows\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\AppX\System.Numerics.Vectors.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The program '[8104] MauiBugCrashOnLaunchOnWindows.exe' has exited with code 2147942405 (0x80070005).

VS bug #1745792

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Reactions:40
  • Comments:89 (21 by maintainers)

github_iconTop GitHub Comments

88reactions
Dayjaycommented, Dec 14, 2022

What worked for me: Build your app in any mode. It will crash on startup as expected.

Now go to the windows start menu, right click the app you just build: More => Run as Admin.

The app will start and so will every other MAUI app from now on even when started within Visual Studio.

25reactions
mattleibowcommented, Jan 10, 2023

A workround seems to be to set

<WindowsAppSdkDeploymentManagerInitialize>false</WindowsAppSdkDeploymentManagerInitialize>

in my csproj. This is because the wasdk is adding some extra dependency by accident. So this disables that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio update broke MAUI app : r/csharp
I Just updated to Visual Studio 17.4.4 and i can't run/debug my MAUI blazor project ... has exited with code 2147942405 (0x80070005).
Read more >
Trouble with Microsoft Visual Studio Enterprise 2022 (64-bit)
This is an issue on Visual Studio 2022 version 17.4.3. You can refer to the thread on github MAUI apps crash on launch...
Read more >
vs2022 17.4.3 创建maui应用程序,调试windows machine
... can refer to the solution in it: MAUI apps crash on launch on Windows after Visual Studio update - code 2147942405 (0x80070005)...
Read more >
(Solved) How to fix Error Code 0x80070005
Open Control Panel · Click on System and Security >Troubleshooting and then click Fix problems with Windows Update · Click Advanced · Select...
Read more >
Use App Center Analytics, Crashlytics and more with .NET MAUI
A lot of people were worried that Visual Studio App Center was dead, but fear no more! A prerelease package has been published...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found