1

I have a .NET 10 MAUI app configured with Aspire 13. When I start the Aspire project and the dashboard launches, I ensure that the emulator is running.

Steps to reproduce

  1. Start Visual Studio
  2. Create a new .NET MAUI App project MauiApp1
  3. Select .NET 10 as the framework
  4. Choose "Enlist in .NET Aspire orchestration". Select Aspire version 13
  5. The project will be created
  6. Once created run the MauiApp1.AppHost project
  7. The Aspire dashboard will open
  8. Wait until the mauiapp1 resource has started
  9. Start your Android emulator, if not already started
  10. Once the mauiapp1 resource has started, start the mauiapp1-android-emulator

Expected results

The Aspire project should open the app in the emulator. This process has been demonstrated in several videos from Gerald Versluis. But it does not work for me. I have reached out to him but no response so I decided to try here.

Actual result

The Aspire project throws an error in the console and does not start the app in the emulator.

I have used the default setup inside the AppHost.cs as well as used the AddMauiProject method, but in both cases I get the same error.

Version 1: default AppHost.cs file

var builder = DistributedApplication.CreateBuilder(args);

builder.AddProject<Projects.MauiApp1>("mauiapp1");

builder.Build().Run();

Version 2: updated AppHost.cs file using the AddMauiProject method

Include the below reference inside the MauiApp1.AppHost project:

<PackageReference Include="Aspire.Hosting.Maui" Version="13.0.0-preview.1.25560.3" />

AppHost.cs:

var builder = DistributedApplication.CreateBuilder(args);

var mauiApp = builder.AddMauiProject("mauiapp1", @"../MauiApp1/MauiApp1.csproj");

mauiApp.AddAndroidEmulator()
    .WithOtlpDevTunnel();

builder.Build().Run();

Error the is displayed inside the Aspire dashboard for the mauiapp1-android-emulator resource

Successfully executed command 'resource-start'.
A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\MauiApp1\MauiApp1\bin\Debug\net10.0-android'.
Failed to run as a self-contained app.

  • The application was run as a self-contained app because 'C:\MauiApp1\MauiApp1\bin\Debug\net10.0-android\MauiApp1.runtimeconfig.json' did not specify a framework.

I have used Visual Studio 2022 Community, Visual Studio Insiders 2026 , Visual Studio 2026 Community, all with the same results.

I have used emulators: Pixel 7 API 36, Pixel 6 api 34, Pixel 5 api 30, all with the same results

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.