Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remote debugging an ASP.NET Core 1.0 Application on Azure App Service

In essence I have an ASP.NET Core 1.0 (rc1-final) application that I published to Azure App Service and facing an error that only appears there and from the logs it's not clear what's causing it.

So I tried using the remote debugging capabilities of Visual Studio 2015 (Update 1) and the Cloud Explorer to debug the application. The debugging starts, but no break points are hit as the debugging symbols are not loaded.

I've tried both release and debug builds to no avail. The dnx web project is compiled with the "Produce output on build" option (which packages the project into a nuget package), so that the xmldoc is created and published with it (Side note: I am using Swashbuckle's for SwaggerGen for Rest API documentation and need the xmldocs for additional documentation).

I've found a few articles on the old nuget way to create packages and it's -symbol parameter, but didn't find a way to generate or pass the parameter to the dnx/dnu build process and publish it on the server.

For now the App is published via the Azure Publishing tooling within Visual Studio 2015 Update 1.

Anyone got a working solution on how to remote debug (preferably an release compiled version) an ASP.NET Core 1.0 web application on Azure App Service?

like image 481
Tseng Avatar asked Oct 30 '22 05:10

Tseng


1 Answers

The solution is kind of easy, when you know where to look.

The default tooling attaches to the w3wp.exe process and since the DNX apps run outside of it, it can't debug them.

After starting the debugging through the cloud explorer, we can go to Debug > Attach to Process menu, select the App Service instance from the "Qualifer" drop down and then select the dnx.exe process and attach to it, as pointed in this blog post.

Doesn't seems there is any 1-click solution yet.

like image 90
Tseng Avatar answered Nov 09 '22 17:11

Tseng