9

Attach debugger not working for Azure Websites in visual studio 2015

I am getting Below error

Please help


Microsoft Visual Studio

Unable to configure remote debugger.

Could not load properties

Could not load app settings

Could not load connection strings

OK

user1037747
  • 1,307
  • 2
  • 18
  • 38
  • Any luck with this? I'm having the same problem – levitatejay Nov 16 '15 at 01:19
  • Yes Microsoft fixed this issue.. check this link (Check last 10 comments from the post) https://social.msdn.microsoft.com/Forums/sqlserver/en-US/22fa1009-a276-4b3b-8085-3cc639a90690/staging-instance-not-showing-up-in-visual-studio?forum=windowsazurewebsitespreview What I did was I updated my PC with latest Updates NOTE: Make sure you also select this option "Give me updates for other Microsoft products when I update windows" – user1037747 Nov 17 '15 at 03:38

4 Answers4

33

I cringed for this problem for about 3 hours. The solution was to manually attach the debugger through Visual Studio's "Attach to Process".

Here are the steps.

1) Let's enter to Azure's portal @ https://portal.azure.com, and head to your App Services directory (as shown in the image).

2) Click on the App you would like to debug.

enter image description here

3) Click Settings or All Settings (both will launch the "All Settings" blade)

enter image description here

4) Go to Application Settings and scroll down. In there you will see "Remote Debugging". It is very important to check that this is turned on, as the image show. Select your appropriate Visual Studio version. Note, that if you're visiting from the classic portal you will not be able to select Visual Studio 2015.

enter image description here

5) Press Save.

If you have never set up an FTP account for your App Service, continue reading, otherwise jump to step 8.

6) In the already opened "All Settings" blade, scroll down and look for "Deployment credentials". In here you will create an FTP username and password. Put whatever you want. Of course, I recommend you to use a different username than your account and a strong password for it.

enter image description here

7) Click Save.

8) In case you've forgotten about your FTP username, in the main page of your web app (where you clicked "All Settings"), you will have your deployment username. In this example, you will use the one that goes after the slash. If it is mywebsite\userftp you will use userftp.

enter image description here

9) Let's head to Visual Studio. Open the project you want to debug, and select the "DEBUG" tab.

enter image description here

10) Click on "Attach Process". Of course, you can just hit Alt + P and that will also open the window for you!

11) Now you will focus in the Qualifier. Put in there your azurewebsites.net domain. You could try with your .com domain, but in my case it didn't work. I am using Cloudflare to enable https on my shared Azure website and it seems that it is filtering the connection with the debugger.

12) Press Enter on your Keyboard or hit "Refresh" button.

enter image description here

13) The following prompt will appear:

enter image description here

14) As the picture says: The username will be: theSameWebsiteYouPutInTheQualifier.azurewebsites.net**.**exampleftp

Please note the following:

a) You must put the same website URL you put in the qualifier.

b) You must put the dot and the backward slash after the .net or .com

c) You must put your FTP username. Remember after reading point 8, that if you lose this one, you must check on Azure website and use the name after the backward slash.

Press OK. If you receive some errors, check that Remote Debugging is turned on. It has happened to me that it has turned off without noticing.

15) Select w3wp.exe and press "Attach" enter image description here

16) This shall put you with the goody orange "Ready" bar :D

enter image description here

Jose A
  • 10,053
  • 11
  • 75
  • 108
  • 7
    Your answer save my life. Thanks. Btw, my case. in step 13) the username and password I did put exactly the same from publishing profile. (the username part is NAME\$NAME ) http://i.stack.imgur.com/A06Nz.png ) Note: publishing profile can be downloaded from the down-arrow in the App Service blade http://i.stack.imgur.com/DWYvT.png – Eric F. Apr 04 '16 at 11:53
  • You are welcome! Really glad to help! :D Interesting about your username. Thanks for letting everyone know! – Jose A Apr 04 '16 at 12:52
  • 1
    Thanks for this... I don't get the prompt in step 13... It never asks for my username and pw for ftp... any ideas ? Here is my error - it seems to want the ftp user and pw: System.Runtime.InteropServices.COMException (0x89710023): Unable to connect to the Microsoft Visual Studio Remote Debugger named 'mytestsitethatwillnotdebugfff.azurewebsites.net'. The Visual Studio 2015 Remote Debugger (MSVSMON.EXE) does not appear to be running on the remote computer. This may be because a firewall is preventing. String site, String user, String password) – Danimal111 Feb 07 '17 at 19:19
  • 1
    Thanks for all this great detail! I needed an outbound port (3702) opened to allow the debugger to attach... https://msdn.microsoft.com/en-us/library/mt592018.aspx. – Danimal111 Feb 07 '17 at 20:28
  • 1
    The ftp user did not work for me. I found somewhere that you can use the credentials from the publish settings that you can download from Azure for your website. I used those credentials and it worked. – elector Apr 12 '17 at 20:03
  • It appears that the connection credentials have changed to using the publish profile credentials as @elector said – Scott Lance May 23 '17 at 04:26
  • @ScottLance and elector Thanks for pointing it out. I believe (I could be wrong), the publishing profile has been in use for a while. The method above I've used it whenever the publishing profile is giving me problems. If the publishing profile is working, there is no reason to use this method ;) – Jose A May 29 '17 at 14:33
5

Assuming your project settings are correct, this will often resolve the issue:

  • Go to the Azure portal and Stop / Restart your web app

If that doesn't work:

  • Close Visual Studio.
  • Go to the Azure portal and Stop / Restart your web app
  • Restart visual studio
Lars
  • 9,976
  • 4
  • 34
  • 40
  • 5
    Reinstall Visual Studio -> Restart your PC -> Apply Latest Windows Updates -> cmd sfc /scannow -> Boot into safe mode -> Use a recovery Disk -> Reinstall your windows -> Put a bullet into your head. – Cristian E. Oct 07 '16 at 13:51
1

Much more surefire route at http://blog.falafel.com/remote-debugging-azure-websites-day-31-visual-studio-2015/ .

Open up server explorer. Navigate in through the azure node to your web app. right-mouse and attach debugger.

Configures all the goodies

Joe Healy
  • 5,769
  • 3
  • 38
  • 56
0

Seems to be a false positive error dialog. If you just press Ok, the debugger attaches to the Azure web app despite showing this dialog. enter image description here