question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VSCode/CLI Support for running MAUI apps on Windows just like Mac

See original GitHub issue

Description

Hello MAUI team,

I love what you all are doing with one code base for many platforms. And I would like to use MAUI for my apps. But I have a windows laptop and not a powerful one. Visual Studio takes a lot of space and memory when I install and use it for building apps. I use VSCode for all of my ASP.NET Core/Blazor apps and I love it.

I tried to find similar feature request but I could not. Can we please add VSCode/CLI support for running MAUI apps on Windows? I remember this feature being there in the past not sure why it was removed 😦

Thanks Curious Drive

Public API Changes

not sure which API needs to be changed for this.

Intended Use-Case

In terminal, we should be able run dotnet run and an Android/iOS emulator should open showing the latest code changes,

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:4
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jfversluiscommented, Jun 16, 2022

Thanks for the suggestion @CuriousDrive!

But I have a windows laptop and not a powerful one.

Depending on what you want to do exactly, this is going to be a bottleneck either way, not just because of Visual Studio. Running an Android emulator is not a very lightweight thing to do as well.

But even beyond that, we have announced that the best experience for now will be with Visual Studio. Because .NET MAUI is now part of .NET and the CLI tooling, you can work with the CLI and inherently also with VS Code. However, the selection of emulators etc. won’t be the best experience. You can use the Comet VS Code extension to make your life a bit easier. That extension also works with regular .NET MAUI apps.

If you are interested in getting .NET MAUI to VS Code, please add to this discussion here: https://github.com/dotnet/maui/discussions/46

1reaction
streetwiseherccommented, Jun 3, 2022

I was able to create a simple Hello World application using the .NET MAUI workload, command line tools (CLI) and Visual Studio Code on Windows 10 by following these instructions.

I skipped Step 3 maui-check because it failed with a number of errors for me even though I had all the required software installed. Find out more about maui-check here.

The only changes/differences I had to figure out for my setup were to start the adb (Android Device Bridge) using the command adb start-server before starting my Android emulator and then build the .NET MAUI app with: dotnet build -t:Run -f net6.0-android /p:AndroidSdkDirectory=C:\dev\tools\android\sdk to specify the path to Android SDK on my local machine. If you have Visual Studio installed you can specify where your Android SDK is located, so that you don’t have to supply the /p:AndroidSdkDirectory msbuild parameter each time.

I used the same command line Android SDK setup that I use for React Native and Flutter development. I am 100% command line, and haven’t installed Android Studio or anything except the Android SDK (build tools, platform tools, emulator, OS images, etc). I also don’t have VS 2022 or any Visual Studios other than VSCode installed. I’m not opposed to the full version of Visual Studio (I use it at work), but like you I have an older laptop and a slow ADSL internet connection at home. I wanted to see if I could develop a .NET MAUI app using as minimal a setup as possible.

I’ve deployed builds to local emulators and to physical devices, and so far I’m impressed with how fast it works on my outdated 8+ year old laptop. The initial build and deploy isn’t the fastest, but subsequent ones are tolerable and I bet they’re even faster on better hardware. Of course, I don’t have hot reload working figured out from the command line, and I’m not sure what the final say was on the HOT RELOAD CONTROVERSY of 2021? Initially I remember them coming out and saying hot reload was going to be “limited to Visual Studio”, then it was “prioritized in Visual Studio”, and now I just plain forget what the official statement is.

If you’re on a Mac, check this out from the official documentation: Build an iOS app with .NET CLI

ps. I like your Youtube channel Mr. Curious! 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Official VS Code Support for .NET MAUI on Windows, macOS ...
An official .NET MAUI extension for VS Code has just been launched. You can now develop your .NET MAUI apps with VS Code...
Read more >
Announcing the .NET MAUI extension for Visual Studio Code
The .NET MAUI extension makes it easy to debug and deploy your app to your different target devices (Android, iOS, macOS and Windows)....
Read more >
Install Visual Studio 2022 to develop cross-platform apps ...
Learn how to install Visual Studio 2022 and Visual Studio 2022 for Mac, to develop native, cross-platform apps using .NET MAUI.
Read more >
Curious Drive - I created an issue on #dotnetmaui GitHub...
https://github.com/dotnet/maui/issues/7659. GITHUB.COM. VSCode/CLI Support for running MAUI apps on. Windows just like Mac · Issue #7659 · dotnet/maui.
Read more >
Build your first .NET MAUI app
Learn how to create and run your first .NET MAUI app in Visual Studio 2022 on Windows, or Visual Studio 2022 for Mac....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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 Reddit Thread

No results found

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