I have a function app deployed into Azure and I would like to remote debug it.
remote debugging is activated in the portal
I have tested 32 and 64 bit platform
In Kudu, I can see "msvsmon.exe" running
I have tried manually to "attach to the process" with the port requested in the microsoft documentation regarding Visual studio versions
I have tried from a VM in Azure
I have deactivated firewall in the VM
I have added an outbound rule will all permissions in the vm network settings
I have tried with VS 2019 version and the "Cloud explorer view"
I have tried with VS 2022 (Up to date --> Version 17.3.2) with "connected services"
And I always get this error:
System.Runtime.InteropServices.COMException (0x89710023): Unable to
connect to the Microsoft Visual Studio Remote Debugger named
'HOSTNAME.azurewebsites.net:4024'. The input data was
not in the expected format or did not have the expected value.
at
Microsoft.WebTools.Azure.VS.Operations.IDebuggerInternal120.ConnectToServer(String
szServerName, VsDebugRemoteConnectOptions[] pConnectOptions,
CONNECT_REASON ConnectReason, Int32 fIncrementUsageCount,
IDebugCoreServer3& ppServer) at
Microsoft.WebTools.Azure.VS.Operations.RemoteDiagnosticsSessionBase`1.ConnectToServer(String
hostNameWithPort, String user, String password)
Any idea how to fix ?
Please check the following steps to remote debug in Visual Studio 2022:
Switch the remote debugging to on in Azure Portal Function App Configuration > General Settings
In Visual Studio 2022 Azure Functions Project, publish to Function App in the debug mode.
Click on Open Site to check the function app is up and running. And then click Attach debugger on Hosting options (...) in the VS Publish window.
It will take some time to attach the w3wp process automatically and activating the breakpoint we placed in the Function Code.
After activating the breakpoint, hit the Azure portal function app trigger URL in the browser, then within 2 to 3 minutes, VS will start the remote debugging as you can see in my below Gif.
Related
I have deployed the following API as is to an Azure App Service from Visual Studio.
I have made sure that I have Remote Debugging and Visual Studio version 2022 selected in General settings in the App Service Configuration.
When I try and attach process from Visual Studio to my App Service I get thefollowing error:
In VS 2022, We have an easy and direct way to attach debugger.
After publishing your WebApp, In Hosting settings we will find an option to Attach Debugger.
Once debugger is attached, Remote debugging is enabled in Portal => Configuration Settings automatically.
Place a break point in any of the form which you want to debug.
Visual Studio finds the process, all the symbols will be loaded, and debugger is attached.
I have an Azure Cloud Service solution in Visual Studio 2017 which I debug with Emulator Express.
I'd like "migrate" from Visual Studio to Visual Studio Code. I mean that I'd like to be able to run/debug my cloud service(web role project) in VSCode without the use of Visual Studio at all.
My solution has two project:
Service project - contains .csdef, .ccproj and multiple .cscfg.
Role project - contains the .csproj file and the rest of the sample web role project.
I've tried:
I'm building both of the projects with msbuild, the same way it's been built in visual studio. The problem is running the site locally.
Run a local site with IIS Express VSCode extension and configure the web role project root as site root. It didn't work, I tried to browse the site but I got a notification that the folder of the site can't be viewed as a directory. When I think of it this option is missing all the configuration that is defined in the Service project so how is it suppose to work? Does IIS Express can run an Azure cloud service app locally? Maybe I configure a wrong path?
I've tried running csrun.exe command multiple times with different arguments. Something like this:
"C:\Program Files\Microsoft SDKs\Azure\Emulator\csrun.exe"
/run:./csx/Debug/roles/WebRoleProject/approot;./ServiceConfiguration.myconfig.cscfg /launchBrowser
/launchDebugger:%systemroot%/System32/vsjitdebugger.exe
It gave me the following error:
The compute emulator had a error: Can't locate service descriptions..
I also saw here that compute emulator(csrun.exe) needs visual studio opened as administrator, so maybe it's not possible to run it without it..
I’ve verified this question with the Azure Cloud Compute team and this is not supported in VSCode, they only built an extension for Visual Studio.
I recently installed Visual Studio 2017 and my problems began with remote debugging.
So, this is the message error.
And on Azure, they are lagging behind the official release of VS Remote Debugging for this VS version.
Any idea on how to make this work?
If you use Cloud Explorer within Visual Studio 2017 to initiate the Remote Debugging it'll set the VS Version on the Web App correctly. Currently, the portal doesn't include UI to allow you to set 2017 as the version, but using the Cloud Explorer to initiate remote debugging will do it behind the scenes. We just need to wait for the Azure Portal to be updated and get caught up with VS.
Visual Studio 2017 is now listed as a Remote Debugging Version in Azure.
There has however been some change on what is possible on Cloud Explorer. To access the 'Attach Debugger' option, you need to use the Server Explorer.
I have just upgraded to VS2015 and when I try to connect the Remote Debugger to an Azure web app, I get this error:
The following error occurred while launching remote debugging: Unable
to connect to the Microsoft Visual Studio Remote Debugger named
'xxxxxxx.azurewebsites.net'. The remote debugger is older than this
version of Visual Studio 2015, and Visual Studio is no longer
compatible with it. Please upgrade your remote debugger to match
Visual Studio.
I have checked the Azure Web App settings and Remote Debugging is on, and VS2015 is selected as the remote debugger.
The Azure App Service Support - Event Viewer is reporting this warning
Msvsmon was unable to start a server named '127.0.0.1:50245'. The
following error occurred: An instance of the remote debugger is
already running on this computer, or another process is already bound
to the specified TCP/IP port. View Msvsmon's help for more
information. 08005E80
I guess this is problem but how do I resolve it?
Make sure you deploy a 'DEBUG' build of your application to Azure App Service from Visual Studio 2015. If the debugger still won't connect, you could try making sure to have the latest updates installed to your local Visual Studio 2015, then try it again.
I'm trying to remotely debug a web app on azure. I published using Web Deploy the debug configuration, and added the breakpoint, right clicked on the Attach Debugger on my Web App instance and the debugger launched and everything is looking good.
But after waiting for like 20sec for the page to load( the debugger launched my website), the visual studio debugger terminates and im being returned to normal editing, and the web page actually load on the browser. Have no clue what that might be happening.
Do you enable Remote Debugging for the right Visual Studio version in your web app configuration?