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 :
Start visual studio
Start Visual StudioCreate a new .NET MAUI App project named "MauiApp1"
Create a new .NET MAUI App projectMauiApp1Select .NET 10 as the framework
Select .NET 10 as the frameworkChoose "Enlist in .NET Aspire orchestration". Select aspire version 13
Choose "Enlist in .NET Aspire orchestration". Select Aspire version 13The project will be created.
The project will be createdOnce created run the MauiApp1.AppHost project.
Once created run theMauiApp1.AppHostprojectThe Aspire dashboard will open
The Aspire dashboard will openwait until the mauiapp1 resource has started
Wait until the mauiapp1 resource has startedStart your android emulator, if not already started
Start your Android emulator, if not already startedOnce the mauiapp1 resource has started, start the mauiapp1-android-emulator
Once themauiapp1resource 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