how to enable debug in release mode in MAUI mobile application

Bhuwan 881 Reputation points
2024-10-27T14:49:38.69+00:00

How can I enable debugging in release mode? Some functionalities are not working when I release the app, but they work in debug mode. I've tried multiple methods but haven't found a proper solution.

Inside .csproj file

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-android|AnyCPU'">
	<AndroidPackageFormat>apk</AndroidPackageFormat>
	<AndroidUseAapt2>True</AndroidUseAapt2>
	<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
	<DebugType>full</DebugType>
	<DebugSymbols>true</DebugSymbols>
	<AndroidDebuggable>true</AndroidDebuggable>
</PropertyGroup>

or in AndroidMainfest file i also enable Debuggable true but it's not working.

Developer technologies .NET .NET MAUI
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bhuwan 881 Reputation points
    2024-10-28T02:58:35.0166667+00:00

    working fine both Android and iOS

    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|net6.0-android' ">
      <DebugType>portable</DebugType>
      <DebugSymbols>true</DebugSymbols>
      <Optimize>false</Optimize>
      <DefineConstants>TRACE;RELEASE</DefineConstants>
      <AndroidLinkMode>None</AndroidLinkMode>
    </PropertyGroup>
    
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|net6.0-ios' ">
      <DebugType>portable</DebugType>
      <DebugSymbols>true</DebugSymbols>
      <Optimize>false</Optimize>
      <DefineConstants>TRACE;RELEASE</DefineConstants>
      <MtouchLink>Full</MtouchLink>
    </PropertyGroup>
    
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.