WindowsAppSDK icon indicating copy to clipboard operation
WindowsAppSDK copied to clipboard

Unable to run Windows application from .NET SDK command line

Open mattleibow opened this issue 1 year ago • 7 comments

Describe the bug

See more details in https://github.com/dotnet/maui/issues/5975

We should be able to run a windows app with dotnet run or dotnet build -t:Run at the very least.

Steps to reproduce the bug

  1. New WinUI app using net6+
  2. dotnet run

Expected behavior

App launches (for both packaged and unpackaged)

Screenshots

No response

NuGet package version

1.1.4

Packaging type

No response

Windows version

No response

IDE

Other

Additional context

No response

mattleibow avatar Aug 30 '22 15:08 mattleibow

There are ways to launch packaged apps from the command line. See https://github.com/dotnet/maui/issues/5975#issuecomment-1234510397

If you're looking to run dotnet.exe and have it launch your app (and that doesn't happen today) that's a .NET issue you should discuss further with the .NET team (e.g. via that MAUI issue thread). Windows has APIs to programmatically launch packaged apps but it would be up to dotnet.exe to call them.

DrusTheAxe avatar Sep 01 '22 16:09 DrusTheAxe

Did @DrusTheAxe's suggestion resolve this issue?

gabbybilka avatar Sep 16 '22 16:09 gabbybilka

The first step might be to follow several other workloads and make a "Run" target that the dotnet run CLI can use. Having the core sdk know about all the different permutations of different apps might not be that feasable.

So having each framework do the thing, and the core SDK just execute it is probably better - and run may also need a build so a Run depends on Build is super easy.

But as of today, we have nothing. So a Run target is going to be very helpful.

mattleibow avatar Oct 17 '22 23:10 mattleibow

I think the issue I raised here on SO is similar.

AvtsVivek avatar Nov 04 '22 03:11 AvtsVivek