June 12th, 2024
heart12 reactions

The .NET MAUI Extension for Visual Studio Code is now Generally Available

Principal Product Manager

Today, we’re thrilled to announce that the .NET MAUI VS Code extension is out of preview, and includes some long-awaited new features – including XAML IntelliSense and Hot Reload!

What is the .NET MAUI extension?

The .NET MAUI extension brings the tools you need to develop .NET MAUI apps into the lightweight Visual Studio Code experience. It’s built on top of C# Dev Kit and the C# extension, which bring in a Solution Explorer, C# Hot Reload, powerful C# IntelliSense, and much more. The .NET MAUI extension adds the ability to target mobile and desktop devices, plus – with the latest releases of the extensions – XAML IntelliSense and XAML Hot Reload, while keeping your VS Code experience streamlined and simple.

New & improved XAML editing experience

The Preview version of the .NET MAUI extension shipped with basic XAML syntax highlighting and completions, but it was far from the full experience we wanted to deliver. Over the past year, we’ve modernized the existing XAML Language Service in Visual Studio, packaged it up, and brought it over to VS Code for your .NET MAUI development. This addition, which also works with Copilot, gives you intelligent autocomplete, helpful tooltips, and seamless code navigation while you create your UIs.

Hot Reload is here 🔥

Being able to edit your code without restarting your app is one of the most powerful productivity features that .NET developers have. With the latest release, you can now Hot Reload edits to your C# and XAML files in Visual Studio Code. XAML Hot Reload is already enabled – simply edit your XAML while the app is running, and watch the changes automatically reflect in your UI!

C# Hot Reload is still in an experimental state, but you can turn it on by opening VS Code Settings (CTRL/CMD + SHIFT + ,), searching “hot reload”, and checking the box for “[Experimental] Enables Hot Reload while debugging”.

A picture showing the settings page where the hot reload checkbox is

Then, edit your C# and save or press the fire icon in the debug toolbar to apply your changes!

A screenshot showing the fire icon to trigger a hot reload

Get started today

Today’s release is a great milestone in our VS Code journey, but we aren’t done yet! We’ll continue to listen to your feedback and work toward improved performance, reliability, and added features to make your .NET MAUI app development more streamlined. To file a bug or share a suggestion, you can use the Help > Report Issue dialog in VS Code. Just like C# and C# Dev Kit, we will release on a monthly cadence with a weekly update in the prerelease channel.

To start using the extension, you can read our Getting Started Guide or download the extension and follow the walkthrough in VS Code!

Author

Maddy Montaquila
Principal Product Manager

Maddy is a Product Manager taking the pain out of modern app dev with Aspire💫

15 comments

Discussion is closed. Login to edit/delete existing comments.

Sort by :
  • Mario

    Please open source Visual Studio for Mac! Microsoft's ever growing list of abandoned tech has become crippling for those trying to make a living with this tech. At least give us a chance to help ourselves. My not so small enterprise clients are initiating a wholesale shift over to Apple tech because Microsoft is dropping support of their on tech both on Windows and Mac. VS Code is too limiting. It's another nail in the coffin for Microsoft tech that had viability on Mac. Or reverse position on Visual Studio for Mac by restarting...

    Read more
  • Dean Jackson

    Did they turn off comments on the Visual Studio blog?

    • nawfalhasan

      Looks like it. Weird decision..

  • Vincent Wang · Edited

    I don’t see functions that would assist you in creating a release build for publishing to an app store, like the Play Store. While it’s possible to achieve this through command-line tools, what I’m looking for is a Release configuration similar to what Visual Studio offers. Is the absence of such a feature intentional, or will it be added in the future?

  • Rolf Noot

    I got an error when working with Plugin.BLE as HotReloadMobileTapInitializer uses System.Diagnostics.Trace which is an ambiguous to Plugin.BLE.Abstractions.Trace

    /Users/rolf/Downloads/MauiXAMLBluetoothLE/MauiXAMLBluetoothLE/Microsoft.VisualStudio.HotReload.MobileTapInitializer/Microsoft.VisualStudio.HotReload.MobileTapInitializer.ModuleInitializerGenerator/HotReloadMobileTapInitializer.g.cs(17,45): error CS0104: ‘Trace’ is an ambiguous reference between ‘Plugin.BLE.Abstractions.Trace’ and ‘System.Diagnostics.Trace’ [/Users/rolf/Downloads/MauiXAMLBluetoothLE/MauiXAMLBluetoothLE/MauiXAMLBluetoothLE.csproj::TargetFramework=net8.0-ios]

    The file HotReloadMobileTapInitializer.g.cs is also not available at that location and I cannot find it.

    How to solve?

    • Bret JohnsonMicrosoft employee

      Did you add a “global using” in your project for Plugin.BLE.Abstractions? If so, removing that global using for now, as a temporary workaround, should avoid the Trace ambiguous reference. Let us know if you have any other issues after that.

      I’ll also make a permanent fix so that the HotReloadMobileTapInitializer.g.cs source (which is generated via a source generator) fully qualifies System.Diagnostics.Trace, so that this problem shouldn’t happen in the future. My fix for that should be included in our next monthly release channel update.

      • Rolf Noot

        Thank you for the reply. Yes I added ‘global using’. Changed ‘global using Plugin.BLE.Abstractions.Trace’ to using ‘Plugin.BLE.Abstractions.Trace’ and it works fine now!