CodexBloom - Programming Q&A Platform

Visual Studio 2022 - working with 'The debugger is not attached' scenarios when trying to debug a .NET MAUI app

πŸ‘€ Views: 2 πŸ’¬ Answers: 1 πŸ“… Created: 2025-06-09
visual-studio-2022 dotnet-maui debugging C#

I've looked through the documentation and I'm still confused about I tried several approaches but none seem to work... I'm relatively new to this, so bear with me. I'm working with an scenario while debugging my .NET MAUI application in Visual Studio 2022. Every time I attempt to start debugging, I receive the behavior message: **'The debugger is not attached'**. This happens after I recently updated to Visual Studio 2022 version 17.5.0. I have checked my project configuration and ensured that the target framework is set to .NET MAUI. Here’s the relevant part of my `launchSettings.json`: ```json { "profiles": { "MyMauiApp": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, "applicationUrl": "https://localhost:5001;http://localhost:5000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } } } } ``` I've tried cleaning the solution and rebuilding it multiple times without any success. Additionally, I made sure that the **Enable Just My Code** option is unchecked in the Debugging options. I also checked if there are any updates available for my installed workloads and extensions, but everything seems up to date. Another thing I noticed is that when I run the app without debugging (Ctrl + F5), it works fine, and I can access the main page without any issues. However, when I switch back to debugging mode (F5), the behavior pops up immediately. Could this be related to my project setup or the way MAUI interacts with Visual Studio? Any insights or suggestions on how to resolve this would be greatly appreciated! My development environment is macOS. Has anyone else encountered this? I'm working on a API that needs to handle this. This is part of a larger service I'm building. Any help would be greatly appreciated!