Skip to main content
deleted 9 characters in body; edited title
Source Link
marc_s
  • 759.8k
  • 186
  • 1.4k
  • 1.5k

Start androidAndroid emulator with .NET Maui app from .NET aspireAspire dashboard

I have a .NET 10 .NET MauiMAUI app configured with Aspire 13. When iI start the Aspire project and the dashboard launches i, I ensure that the emulator is running. See below :

  1. Start visual studio

    Start Visual Studio
  2. Create a new .NET MAUI App project named "MauiApp1"

    Create a new .NET MAUI App project MauiApp1
  3. Select .NET 10 as the framework

    Select .NET 10 as the framework
  4. Choose "Enlist in .NET Aspire orchestration". Select aspire version 13

    Choose "Enlist in .NET Aspire orchestration". Select Aspire version 13
  5. The project will be created.

    The project will be created
  6. Once created run the MauiApp1.AppHost project.

    Once created run the MauiApp1.AppHost project
  7. The Aspire dashboard will open

    The Aspire dashboard will open
  8. wait until the mauiapp1 resource has started

    Wait until the mauiapp1 resource has started
  9. Start your android emulator, if not already started

    Start your Android emulator, if not already started
  10. Once the mauiapp1 resource has started, start the mauiapp1-android-emulator

    Once the mauiapp1 resource has started, start the mauiapp1-android-emulator

Expected Resultsresults
The

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 iI decided to try here.

Actual result
The

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

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

Version 1 : Default AppHost.cs file: default AppHost.cs file

VErsionVersion 2: Update AppHost.cs file using the AddMauiProject method: updated AppHost.cs file using the AddMauiProject method

Include the below reference inside the MauiApp1.AppHostMauiApp1.AppHost project:

AppHost.csAppHost.cs:

Error the is displayed inside the Aspire dashboard for the mauiapp1-android-emulator resource 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.

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 insidersInsiders 2026 , Visual Studio 2026 community andCommunity, all with the same results.

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

Start android emulator with .NET Maui app from .NET aspire dashboard

I have a .NET 10 .NET Maui app configured with Aspire 13. When i start the Aspire project and the dashboard launches i ensure that the emulator is running. See below :

  1. Start visual studio

  2. Create a new .NET MAUI App project named "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
The Aspire project gives me 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

VErsion 2: Update AppHost.cs file using the AddMauiProject method

Include the below reference inside the MauiApp1.AppHost project

AppHost.cs

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 and same results.

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

Start Android emulator with .NET Maui app from .NET Aspire dashboard

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.

  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

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

Include the below reference inside the MauiApp1.AppHost project:

AppHost.cs:

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

Source Link

Start android emulator with .NET Maui app from .NET aspire dashboard

I have a .NET 10 .NET Maui app configured with Aspire 13. When i start the Aspire project and the dashboard launches i ensure that the emulator is running. See below :

Steps to reproduce

  1. Start visual studio

  2. Create a new .NET MAUI App project named "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
The Aspire project gives me 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: Update 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 and same results.

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

created from staging ground