I run my MAUI application with release mode. App get started but when it trying to call API app crashes (In my case user login process).I can assure API request fails because I check it form Event Viewer(I set up API application on IIS). My app work well in Debug mode. I disable AOT and app shrinking but it not worked. I have doubt of created HTTP Client for the release mode. Otherwise I couldn’t see any fault but there is a fault.
This is how I created the HttpClient
#if DEBUG
HttpsClientHandlerService handler = new HttpsClientHandlerService();
HttpClient client = new HttpClient(handler.GetPlatformMessageHandler());
#else
HttpClient client = new HttpClient();
#endif
How to solve this problem.Any help is highly appreciated.