DotNet.Meteor icon indicating copy to clipboard operation
DotNet.Meteor copied to clipboard

A VSCode extension that can run and debug .NET apps (based on Clancey VSCode.Comet)

.NET Meteor Features | Documentation | Support


Overview

 The .NET Meteor allows you to build, debug .NET apps and deploy them to devices or emulators.

  • Cross-Platform You can use this extension in the Windows, MacOS, and Linux operation systems.

  • XAML IntelliSense The extension provides you with a basic XAML syntax highlighting and shows snippets for .NET MAUI / third-party controls (it's necessary to build your project first).

  • XAML Hot Reload Meteor support XAML Hot Reload for any platform. See the instruction below to enable Hot Reload in your project.

  • Performance and Memory Profiling You can profile your application to find performance bottlenecks and undisposed objects that persist in the memory.

  • MAUI Blazor Support The extension allows you to build and debug MAUI Blazor apps (including the .razor files).

  • Multiple Folders in a Workspace You can use muliple folders in your workspace and change the current running project.

  • F# support Your can build and debug projects, written in the F# language.


Run the Application

  1. Open the project folder.
  2. Open the Run and Debug VSCode tab and click the create a launch.json file.
  3. In the opened panel, select the .NET Meteor Debugger.
  4. In the status bar, select a project (if your opened folder contains several projects) and a configuration (the debug is the default).
  5. In the status bar, click the device name and select a target device/emulator from the opened panel.
  6. Press F5 to debug the application or ctrl + F5 to launch the application without debugging.
  7. Enjoy!

image


Enable XAML Hot Reload

  1. Open the .csproj file of your project and add the following package reference:
<ItemGroup>
	<PackageReference Include="DotNetMeteor.HotReload.Plugin" Version="3.*"/>
</ItemGroup>
  1. Enable Hot Reload Server in your MauiProgram.cs:
using DotNet.Meteor.HotReload.Plugin;

public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        var builder = MauiApp.CreateBuilder();
        builder
            .UseMauiApp<App>()
#if DEBUG
            .EnableHotReload()
#endif
        ...
        return builder.Build();
    }
}
  1. Now you can run your project, update XAML and see updates in real-time!

image


Profile the Application

  1. Open the project folder.
  2. Open the Run and Debug VSCode tab and click the create a launch.json file.
  3. In the opened panel, select the .NET Meteor Debugger.
  4. Specify a profiler mode option (trace or gcdump) in the generated configuration. For example:
{
	"name": ".NET Meteor Profiler",
	"type": "dotnet-meteor.debugger",
	"request": "launch",
	"profilerMode": "trace",
	"preLaunchTask": "dotnet-meteor: Build"
}
  1. In the status bar, select a project (if your opened folder contains several projects) and a configuration (the debug is the default). Click the device name and select a target device/emulator from the opened panel.
  2. Press ctrl + F5 to launch the application without debugging.
  • If you use the gcdump mode, type a /dump command in the Debug Console to capture the report. You will see the message:
Writing gcdump to '/Users/You/.../.meteor/MauiProf.gcdump'...
command handled by DotNet.Meteor.Debug.GCDumpLaunchAgent
Finished writing 2759872 bytes.
  • If you use the trace mode, click Stop Debugging in the VSCode to stop the profiling. Don't close the application manually, because this may damage the report. After completion, you will see the message:
Trace completed.
Writing:	/Users/You/.../MauiProf/.meteor/MauiProf.speedscope.json
Conversion complete
  1. You can see the speedscope.json report in the .meteor folder of your project. You can use the Speedscope in VSCode extension to view it. Alternatively, you can upload it directly to the speedscope site. For the gcdump report, you can use the dotnet-heapview or Visual Studio for Windows.

image

The profiler can capture and analyze functions executed within the Mono runtime. To profile native code, you can leverage platform-specific tools, such as Android Studio and Xcode.


Compatibility

 The following table lists supported .NET target platforms and their capabilities:

Application Type Build and Run Hot Reload Debugging Profiling
WinUI
Android
iOS
MacCatalyst

You can debug WinUI apps using the C# VSCode extension with attaching the .NET Core Debugger.


About the Author

 I'm Nikita Romanov, a passionate programming enthusiast with a focus on .NET MAUI. I work with an amazing team at DevExpress to make the lives of developers around us easier. Our team is dedicated to creating a comprehensive mobile component suite for .NET MAUI which is currently available free-of-charge. In my free time, I work on my hobby project, DotNet.Meteor, which is always open to feedback and contributions. Feel free to share your thoughts with me, and let's make the .NET MAUI community even better together!