dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.28k stars 1.76k forks source link

Directly executing the Run command on the .NET MAUI App on the Windows platform in .NET 8 Preview 2 ends up in an error #13942

Open egvijayanand opened 1 year ago

egvijayanand commented 1 year ago

Description

Directly executing the Run command on the .NET MAUI App on the Windows platform as an Unpackaged App in .NET 8 Preview 2 ends up in an error.

Whereas building and then executing the project as a two-step action works fine.

The direct-run approach worked fine in Preview 1. A separate build step was not required in the earlier preview.

Steps to Reproduce

First, execute the Run command directly to visualize the error. Then issue the Build command and then the Run command again.

Run command:

dotnet build -f net8.0-windows10.0.19041.0 -p:WindowsPackageType=None -t:Run

Build command:

dotnet build -f net8.0-windows10.0.19041.0 -p:WindowsPackageType=None

Link to public reproduction project repository

Default template itself is suffice, no authored code

Version with bug

8.0 previews

Last version that worked well

8.0 previews

Affected platforms

Windows

Affected platform versions

Windows SDK 10.0.19041

Did you find any workaround?

First, build and then run the project.

Relevant log output

C:\Program Files\dotnet\sdk\8.0.100-preview.2.23157.25\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(932,5): error MSB3073: The command "E:\NET_8\Preview_2\MauiApp1\bin\Debug\net8.0-windows10.0.19041.0\win10-x64\MauiApp1.exe " exited with code 3. [E:\NET_8\Preview_2\MauiApp1\MauiApp1.csproj::TargetFramework=net8.0-windows10.0.19041.0]

VS bug #1773325

Depends on

mattleibow commented 1 year ago

Related to https://github.com/microsoft/WindowsAppSDK/issues/2922

ghost commented 1 year ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

mattleibow commented 1 year ago

Related to https://github.com/dotnet/maui/issues/5975

egvijayanand commented 1 year ago

Ideally, the Run command should trigger a build if it is yet to be built or a change in the compilation artifacts.

Rather it simply attempts to run the executable. as from the log message, it is understood that it ends up with ... exited with code 3, which means that the ERROR_PATH_NOT_FOUND - The system cannot find the path specified.

Zhanglirong-Winnie commented 1 year ago

Visual Studio Enterprise 17.8.0 Preview 2.0. Can repro this issue.

mattleibow commented 1 year ago

This is a known issue with .NET + Windows + Windows App SDK: https://github.com/microsoft/WindowsAppSDK/issues/2922