Debug .Net Core in Azure App Service from Visual Studio
Elena Salcedo
ă»2 min read
OK, I must confess, I said: It works on my machine.
When I uploaded my code to DEV environment.. ÂĄSurprise! It crashes.
After doing some test in both, my local and dev environments, checking App Insights, Google and find out nothing, I decided to attach Visual Studio debugger to the Web App (only after telling my team about it, and only because it was DEV environment).
Thus, make sure that the App Service on Azure has remote debugging enabled.
MyAppService -> Configuration -> General Settings -> Debugging
Letâs attach the debugger from Visual Studio:
Cloud Explorer -> MySubscription -> AppServices -> rightclic en MyAppService -> Attach debugger
Suddenly, a wild Pop Up appears on Visual Studio with something Iâve never ever seen:
Unable to attach to application âdotnet.exeâ (PID: 9504) using âmywebappâ. The 64-bit version of the Visual Studio Remote Debugger (MSVSMON.EXE) cannot be used to debug 32-bit processes or 32-bit dumps. Please use the 32-bit version instead.
It seems that Iâm trying to attach a 64 bit debugger to a 32 bit process. However, my Web App is configured to run on 64 bit:
MyAppService -> Configuration -> General Settings -> Platform Settings
How can the process run on 32 bit? Letâs check KUDU. We now can see that the .NET Core process that runs our application is on 32 bit:
Kudu -> Process Explorer -> rightclick en dotnet.exe(PID:9504)
It turns out that .NET CORE 2.2 SDK available by default at the Azure App Services is for 32bits
Thus, it does not take any effect configuring the Web App in 64 bit on Azure Portal. The IIS Worker Process, even running on 64 bit, will spawn .NET Core on 32 bit (due to .NET Core is only available by default on 32 bit). So the Visual Studio Debugger we should attach is the one on 32 bit as well.
If we configure the WebApp to run on 32 bit, Visual Studio will try to attach the 32 debugger this time:
Azure Portal â MyWebApp -> Configuration â General Settings â Platform Settings â Platform: 32 Bit
Nevertheless, if you want to run your application in 64 bit, you can configure the hosting model as InProcess. More info here.
Make better choices about your code and your career.

Debugging microservices running in Azure Kubernetes Service (AKS) using Azure Dev Spaces
Janne Mattila -

Day 10 of the Visual Studio Tips Advent Calendar is now live
Lee Englestone đĄđ§ đšâđ» -

Implementing Microservices with gRPC and .NET Core 3.0
Bachi -
