I am new to azure, I have hosted a asp.net core web api in Azure App services. I am able to browse the azure link. However I am getting some internal error while accessing the service.
To find out the error I want to debug the application by attaching to visual studio. But while attaching the debugger I am getting below error as shown in the image.
ERROR POPUP WHILE ATTACHING DEBUGGER
Error: "Unable to find a process called dotnet with arguments .\APICore.dll. The process may still be starting, please try again."
I have verified that REMOTE Debugging is enabled.
Application is ASP.NET Core.
Visual Studio is VS 2017 community
edition.
In Server Explorer, expand Azure > App Service > your resource group > your app > WebJobs > Continuous, and then right-click ContosoAdsWebJob. Click Attach Debugger. The browser automatically opens to your home page running in Azure.
Now time to enable remote debugging. In your Visual Studio, go to View -> Server Explorer. In the server explorer, configure your Azure account, which will list all your AppServices in the account. Right-click on the AppService that you published in Step 8 and choose “Attach Debugger” as shown below.
Open the Debug view by selecting the Debugging icon on the left side menu. Select the green arrow at the top of the pane, next to . NET Core Launch (console). Other ways to start the program in debugging mode are by pressing F5 or choosing Run > Start Debugging from the menu.
I've had the same problem today, and this is what worked out for me:
1) Instead of attaching the debugger via Server Explorer, go to Debug > Attach to Process...
2) Set the Connection Target to your App Service url without http and with port 4022.
So, http://myappservice.azurewebsites.net would become myappservice.azurewebsites.net:4022
3) Hit the Refresh button. You will be prompted for credentials to access your App Service. Those can be found on the MSDeploy publish profile of your publish profile file:
<publishData>
<publishProfile profileName="myappservice - Web Deploy" publishMethod="MSDeploy"
publishUrl="myappservice.azurewebsites.net:443"
userName="{USERNAME}" userPWD="{PASSWORD}" ...>
<databases />
</publishProfile>
<publishProfile profileName="myappservice - FTP" publishMethod="FTP" ...>
<databases />
</publishProfile>
</publishData>
4) After the available process show up, select w3wp.exe and hit Attach
Had the exact same issue, tried several things (open in Admin mode, open outbound port 4022, 'Attach debugger', 'Attach to process') but nothing worked.
Just switched from VS 2017 Community edition to Visual Studio 2019 - Enterprise edition and now it instantly works flawless:
So perhaps switching to 2019 will solve it for you as well.
There are few options that you can try out and see if that helps.
https://docs.microsoft.com/en-us/visualstudio/debugger/remote-debugging-azure?view=vs-2017#remote_debug_azure_app_service
The answer above using a regular "Attach to Process" using creds from a publish profile downloaded from the portal worked for me. VS2019 (community and professional, multiple azure accounts, multiple machines, physical and virtual) here, and the cloud explorer "AttachDebugger" never worked. In fact it hung vstudio at "attaching to process" and had to kill VStudio from task manager to stop it.
Strange because at other companies/projects I didn't have this problem. For years I relied on debugging azure from desktop for a variety of projects. This particular software I inherited, and I expect that something in its origination or construction (there are several ..."sub optimal"... aspects to it).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With