skip to Main Content

I’ve just update Visual Studio 2022 from version 17.4.2 to 17.4.3.

Now it always displays:

"The program ‘[17424] TEST.exe: Program Trace’ has exited with code 0 (0x0).

The program ‘[17424] TEST.exe’ has exited with code 2147942405 (0x80070005)."

…when starting to run debugging on my Windows machine (my computer is running Windows 10 Pro – 19044.2251).

Notice: I’ve just running default template Maui application (for .NET 7) of Visual Studio 20022 – like this:

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         x:Class="TEST.MainPage">

<ScrollView>
    <VerticalStackLayout
        Spacing="25"
        Padding="30,0"
        VerticalOptions="Center">

        <Image
            Source="dotnet_bot.png"
            SemanticProperties.Description="Cute dot net bot waving hi to you!"
            HeightRequest="200"
            HorizontalOptions="Center" />

        <Label
            Text="Hello, World!"
            SemanticProperties.HeadingLevel="Level1"
            FontSize="32"
            HorizontalOptions="Center" />

        <Label
            Text="Welcome to .NET Multi-platform App UI"
            SemanticProperties.HeadingLevel="Level2"
            SemanticProperties.Description="Welcome to dot net Multi platform App U I"
            FontSize="18"
            HorizontalOptions="Center" />

        <Button
            x:Name="CounterBtn"
            Text="Click me"
            SemanticProperties.Hint="Counts the number of times you click"
            Clicked="OnCounterClicked"
            HorizontalOptions="Center" />

    </VerticalStackLayout>
</ScrollView>

</ContentPage>

It’s OK if application is using .NET 6 – but fails if .NET 7 for Windows or Android platform is used (that I’ve checked).

2

Answers


  1. Chosen as BEST ANSWER

    I'v found this: https://github.com/dotnet/maui/issues/12080

    Install Microsoft.WindowsAppRuntime 1.2 redist, it's solved trouble.


  2. 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 on Windows after Visual Studio update for more information.

    This might be an answer for you, you can check this comment link Running the app as admin. Another way to fix the problem is that you can roll back to the version 17.4.2.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search