Skip to content

Breaking Unable to start debugging with an android physical device (Hot Reload) #10141

Closed

Description

@ArtefactoDev

Android framework version

net9.0-android

Affected platform version

VS2022 - Version 17.14.0

Description

Hi!
After updating visual studio yesterday to version 17.14.0, I can no longer debug android application.

I get the following error when I try to debug the application:

`
The program 'MauiApp2.dll' has exited with code 0 (0x0).
New vsdbg debugger process created for project 'C:\Users\workc\source\repos\MauiApp2\MauiApp2.csproj'...
Starting vsdbg debug session for project 'C:\Users\workc\source\repos\MauiApp2\MauiApp2.csproj'...

  • am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.companyname.mauiapp2/crc6452f1ea43b9adf718.MainActivity"

  • Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.companyname.mauiapp2/crc6452f1ea43b9adf718.MainActivity }

The vsdbg debug session for project 'C:\Users\workc\source\repos\MauiApp2\MauiApp2.csproj' has been stopped
`

Android 14
device: Galaxy A15 5G

Steps to Reproduce

1 - Start Visual Studio
2 - Create a New Project
3 - .NET MAUI App (name: MauiApp2)
4 - Debug -> Error

`

<PropertyGroup>
	<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
	<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
	<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
	<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-tizen</TargetFrameworks> -->

	<!-- Note for MacCatalyst:
	The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
	When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
	The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
	either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
	<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->

	<OutputType>Exe</OutputType>
	<RootNamespace>MauiApp2</RootNamespace>
	<UseMaui>true</UseMaui>
	<SingleProject>true</SingleProject>
	<ImplicitUsings>enable</ImplicitUsings>
	<Nullable>enable</Nullable>

	<!-- Display name -->
	<ApplicationTitle>MauiApp2</ApplicationTitle>

	<!-- App Identifier -->
	<ApplicationId>com.companyname.mauiapp2</ApplicationId>

	<!-- Versions -->
	<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
	<ApplicationVersion>1</ApplicationVersion>

	<!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged -->
	<WindowsPackageType>None</WindowsPackageType>

	<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
	<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
	<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
	<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
	<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
	<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

<ItemGroup>
	<!-- App Icon -->
	<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

	<!-- Splash Screen -->
	<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

	<!-- Images -->
	<MauiImage Include="Resources\Images\*" />
	<MauiImage Update="Resources\Images\dotnet_bot.png" Resize="True" BaseSize="300,185" />

	<!-- Custom Fonts -->
	<MauiFont Include="Resources\Fonts\*" />

	<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
	<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
	<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
	<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
</ItemGroup>
`

Did you find any workaround?

Everything I tried didn't work.

Relevant log output

Activity

  1. added
    Area: App+Library Build
    needs-triage
    on May 16, 2025
  2. paulocarinhena commented on May 16, 2025

    @paulocarinhena

    Some problem for me.

    After yesterday's update I can't debug any Android project

  3. rdsfernanda commented on May 16, 2025

    @rdsfernanda

    I also have the same problem after the update

  4. ArtefactoDev commented on May 16, 2025

    @ArtefactoDev
    Author

    I disabled the following feature::

    Image

    I restarted and it worked again.
    Apparently that was the problem.

  5. jonathanpeppers commented on May 16, 2025

    @jonathanpeppers
    Member

    They've migrated from the Mono debugger to the same debugger technology the rest of Visual Studio uses. It should be an improvement going forward, but there could be a bug here.

    /cc @mauroa @emaf

  6. added
    Area: Debugger
    and removed
    needs-triage
    Area: App+Library Build
    on May 16, 2025
  7. jonathanpeppers commented on May 16, 2025

    @jonathanpeppers
    Member

    Does anyone experiencing this, remember checking this box?

    Image

    It should be unchecked by default if you are using VS 17.14 stable.

  8. paulocarinhena commented on May 17, 2025

    @paulocarinhena

    I don't remember changing this.

    But unchecking it returned it to normal.

  9. ArtemSPavlenko commented on May 19, 2025

    @ArtemSPavlenko

    Mine was unchecked by default, however I manually turned it on to try it on a project which has been migrated from Xamarin. Unable to debug the project with the output showing "The vsdbg debug session for project ... has been stopped".

    Was hoping to see some performance improvements in debugging the migrated MAUI Android application but will be keeping it off for now.

  10. pasha-o commented on Jun 5, 2025

    @pasha-o

    I'm experiencing the same issue. I updated VS to 17.14.4, but the problem has worsened now.

  11. jonathanpeppers commented on Jun 10, 2025

    @jonathanpeppers
    Member
  12. rahul7720 commented on Jun 11, 2025

    @rahul7720
  13. moved this from Todo to Consideration in .NET for Android Backlogon Jun 11, 2025
  14. BlueRaja commented on Jun 28, 2025

    @BlueRaja

    [Edit] This ended up being due to a different issue. I will leave this post here, because this was the top result on Google when searching for the error.


    I am seeing the same issue in VS 17.14.7, and I do not have "Enable new .Net Mono debugger" enabled. In fact enabling it causes a different issue:

    Image

    System.Reflection.TargetInvocationException: 'Arg_TargetInvocationException'
    Inner exception
    XamlParseException: Position 31:43. MarkupExtension not found for StaticResource

    and then disabling it causes the original error to resurface:

    Image

    System.IO.FileNotFoundException: ''
    0x22 in HotReloadMobileTapInitializer.LoadHotReloadBootstrapper at ...

    The error mentions "HotReload", but disabling "XAML Hot Reload" does not fix the issue.

  15. jonathanpeppers commented on Jun 30, 2025

    @jonathanpeppers
    Member

    @BlueRaja I would file your separate issue here:

    It's saying the markup extensions "StaticResource" is not found. That's weird and has to be something for MAUI (or related tooling) to look into.

  16. MahmoudAlEssawi commented on Jul 7, 2025

    @MahmoudAlEssawi

    I disabled the following feature::

    Image

    I restarted and it worked again. Apparently that was the problem.

    This works for me.

  17. jonathanpeppers commented on Jul 7, 2025

    @jonathanpeppers
    Member

    Since, this looks related to the debugger in Visual Studio, could everyone follow/upvote here?

    Thanks!

  18. locked and limited conversation to collaborators on Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area: Debugger

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions