Azure: there was a failure to launch the remote debugger - c#

I deployed a web role in windows Azure, based on the following tutorial.
http://weblogs.asp.net/scottgu/archive/2013/10/22/windows-azure-announcing-release-of-windows-azure-sdk-2-2-with-lots-of-goodies.aspx
but when I try attaching the debugger I get the following message:
"there was a failure to launch the remote debugger"
apparently this is a known issue, and the suggested solution from Microsoft is to restart the visual studio and try again, which unfortunately didn't work for me
http://msdn.microsoft.com/en-us/library/windowsazure/dn459835.aspx
Remote debugging may fail to attach to an existing Cloud Service:
After deploying a new Cloud Service the debugger may fail to attach to
an existing cloud service with the error message “There was a failure
to launch the remote debugger”. To correct this problem, restart
Visual Studio and reattach the debugger to the new deployment.
So I thought to ask here in case anybody faced the same issue and found another solution other than restarting the visual studio!
I'm using visual studio 2012, with Azure SDK 2.2

Make sure that you deployed a Debug build to your web role and that you have checked "Enable Remote Debugging for all roles" on the advanced tab during deployment. Failure to do either of these could lead to the problem your seeing.

I was using Azure SDK 2.2, so as to use "Attach debugger", but unfortunately I needed to use SDK 2.1 as 2.2 needs some references that weren't included in 2.1, so I guess this is the problem.
Thank you all for your help

I tried all of the solutions above and found that none worked for me. My problem turned out to be stale or inaccessible certificates that the VS debugger uses to connect to the service. I discovered this was the problem by going to event viewer and found:
A fatal error occurred when attempting to access the SSL client
credential private key. The error code returned from the cryptographic
module is 0x8009030D. The internal error state is 10003.
I had had other problems with permissions on private keys and so I ended up deleting all of the certificates from my personal store (current user) with the "Issued To" equal to "Windows Azure Tools". When I redeployed my service VS created new certificates and uploaded them.
Voilà -- attach remote debugger works again.

I got the same exception trying to remotely debug a VM in Azure, following the guide in Debugging Azure Virtual Machines.
What worked for me was to simply install the remote debugging tools matching my version of Visual Studio (VS2013 Update2).
Further I had to add a new endpoint in the Azure portal. This didn't work initially but eventually using the same public and private port number did the trick. The default port of 4018 worked.
Start the remote debugger program on the client machine in adminstrator mode and remember to set to port number, e.g. to 4018. I chose Windows authentication as well.
From within Visual Studio: Debug menu -> Attach to Process -> [yourVMName].cloudapp.net:4018 or whatever port number you chose. You should now see a list of processes on the virtual machine.

In case its helpful for someone else, I've just spent 3 hours on this! In the end I gave up and using 'Cloud Explorer' (in VS 2013, after installing the Azure SDK) I selected 'Disable Debugging' and noticed it cleared out port rules in the Network Security Group for the VM.
I hadn't seen it set these up (which is where I'd spent hours guessing that these were the issue and trying to figure them out from patchy MS documentation, broken links, etc).
So, I 'enabled debugging' for the VM and saw it set up security rules - something it didn't do the first time!
At a guess this is because I had initially enabled debugging for my VM soon after I installed the Azure SDK into VS. Since then I rebooted the VS server, and that may have enabled something in the SDK.
Anyway - before spending hours figuring out ports, reboot the VS server and then disable/reenable debugging in Cloud Explorer - you should see a status message (in the Azure Activity Log) saying 'Configuring networking security group debugging port' - this is the magic step that it didn't do the first time around.

I think you should try lunching VS in administrator mode, and see if you always have the same problem.
Else I think you should put more details about your problem.

This is what I did to enable debugging on an Azure VM.
At the time of this writing my current setup is as follows
Windows Server 2012 R2 IIS 8.5 (Virtual Machine)
Visual Studio 2013 Update 4
Microsoft Azure SDK Tools 2.5
Update Visual Studio to the latest Azure SDK
go th the server window (server explorer)
Expand the Azure node
Expand the virtual machines node
Right click on the VM you want to debug
Choose "Enable Debugging" Visual Studio will begin to add a debugger extension to your virtual machine
Once complete, Right click on the virtual machine from the virtual explorer and choose attach debugger

Related

Can't debug my asp.net web app developped on visual studio 2015 and hosted on IIS

I am a telecom engineer, I have studied a little bit of coding but I am not a professional, I have to develop a c# asp.net app for my company and I have some issues with debugging my app with Visual Studio 2015. I hosted my app on IIS (not IIS Express, even if I don't understand the difference), when I hit debug (with Firefox, Google Chrome...) a message of error displays where it is written:
unable to start debugging on the web server the remote server returned an error 400
I have litterally tried everything, can you please help me and give me solutions that I will understand (I am no professional), if you need a screen shot or something please let me know.
Clarifications/details (based on comments, etc.), and since "just use localhost/foo" sounds too magical:
if you're debugging on a remote web server (not your own PC), you'll have to setup the remote machine to allow such. This may or may not be feasible (not your server, etc. etc.).
Hence Visual Studio provides local debugging (Express or local IIS)
What is IIS Express?
When I want to start a project I can eather store it on IIS or IIS Express
Sure, but you'll have to know how to set things up (see links)
When I use IIS, and click on debug, I have error 400 and the browser doesnt open But When I use IIS Express and click on debug, it debugs, the browser opens and I have a 500.52 error
Set debug=true. It should give you error/exception detail(s) (also in link above)
So I am storing my project on IIS (inetpub\wwwroot...) and when I design and write my code I just press start without debug and the browser opens with my app appearing
Same as above, that just means IIS is running your app just like any other ASP.Net app. It does not automatically mean you can attach to it and debug.
While you can certainly develop that way (using /wwwroot), you'll be better off deving in your own directory, using VS/IIS Express, and publish to IIS (as simple as file system copy). You'll also learn what publish means (compiling), what in all your code is "published"/needed in live/production. If you kept deving in IIS the way you are, you'll likely not know the difference.
IIS admin is a bigger topic (multiple apps, multiple sites, and associated configuration).

Visual Studio 2015 version 3 freezes on editing Roles in Azure project

I'll preface this with the fact that I'm very new to Visual Studio, so I am prepared to hear that my problem lies in something I haven't read yet.
I have a database first project in Visual Studio 2015 v.3 that I am attempting to publish to an existing Azure account and resource group.
I have successfully converted it to an Azure project via the menu options: Build > Publish to Microsoft Azure.
I can successfully build both the local and the Azure projects without error, but whenever I attempt to edit the Roles in the Azure project to add the Azure connection string as per the tutorial found here, the program hangs up irretrievably. This makes my twelfth attempt to edit the Roles.
It took Visual Studio five tries to publish to Microsoft Azure using the menu options above.
To fix this, I have tried all of the following:
Restarting my computer
Restarting my Azure connection
Restarting Visual Studio
Confirming Visual Studio's connection to the Azure account I want to publish to
Checking to be sure my Azure SDK (version 2.9.1) and Visual Studio (version 3) installations are the most recent versions and that the installation appears to be clean
Removing the Azure portion of the project, cleaning and rebuilding the local solution, and reattempting to publish to Azure
Cleaning and building both solutions before attempting to edit the Roles for the Azure portion of the solution
Confirming that the resource group I am attempting to publish to does exist at the specified connection string and contains the necessary resources (in this case, a server and an SQL database)
I am attempting to connect (for now) with HTTP and not HTTPS, as per other similar questions about Visual Studio 2015 freezing while publishing to Azure
Confirming that I am able to connect remotely to Azure via Visual Studio (this is probably a gimmie, but it doesn't hurt to be specific)
I also notice that when I attempt to browse the Azure features on the menu to the left of the Visual Studio window, Visual Studio freezes (particularly if I click on the links for Data Factory, Mobile Services, Service Bus, and Virtual Machine).
Server Explorer is showing that I am logged in to Azure with the account I'm attempting to publish to.
I can reach, read, and edit the local database files. I can also run the local project without error.
The application was configured to use an IIS Web Server and uses SQL Express. It froze repeatedly while attempting to change configurations from the IIS Express and LocalDB default to IIS Web and SQL Express.
I do have the application backed up locally as well as via a private GitHub repo just in case I manage to bork it permanently trying to do this.
I would very much appreciate the help.
edited to add: I'm currently running Windows 10.
edited again to add: The task manager shows the load to memory and CPU during the period when Visual Studio is frozen to be less than 15%, the majority of which is not Visual Studio. It shouldn't be a hardware issue, but I did try closing the majority of the background services that were non-essential just in case there was some sort of conflict occurring.
Making this an answer instead of a comment because while it may be a silly oversight, there's bound to be someone who would benefit from the answer.
The problem was that I was working from a local copy of a remote database. When it came time to push up to the remote, I deleted the local copy and data interface model, and reconstituted the model on the remote database, creating several connection strings in Web.config.
When I attempted from there to publish, Visual Studio read the connection strings in the Web.config for the project and attempted to hunt down the local and over-write the remote database.
Removing all other connection strings from the Web.config for the project removed many of the problems with freezing and hanging that I was experiencing (and made the project run faster by resolving the search for associated project resources.)
Lesson learned: make sure you clean your Web.config file before attempting to push to remote.

Azure mobile service: publish throwing error VS 2013

I was trying to create azure mobile service from VS 2013, 2 issues I am facing.
Host in cloud option is disabled.
Getting error on click of Validate connection while publishing the project. error thrown there is "Destination is unreachable".
Log I have extracted from output window is :
Error ERROR_DESTINATION_NOT_REACHABLE: Web deployment task failed. (Could not connect to the remote computer ("****.scm.azure-mobile.net"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.)
I have attached screenshot you reference. Please check.
gone through similar question : Not able to publish website on Windows Azure using publish through VS2010
didnt helped though.
Can anyone help me to resolve these issues..? Appreciate the help.
Regards
Ravi Bhat
I encounter this error as well.
I tried changed two things and it works, yet now I don't remember which one is the root cause:
use https instead of http for the server address and destination URL
My company has proxy settings for all internet access, I change to the other WIFI without any proxy. So check your internet connection.
You could try this, but I'm not sure if it works.

Visual Studio 2008 Development Server not starting

I have a C# web service that I am trying to debug in Visual Studio 2008, and when I try to run it, Internet Explorer pops-up as expected, but it just displays 'waiting for response from localhost...' in the status bar. I have left it running for a few minutes and it never responds.
I have other web services that I am able to debug fine, is VS2005 and 2008. The problem web service is impersonating a different identity in the web.config file, but I have no problems with this same user on a different web service (in VS2005).
Does anybody have any ideas on what might be preventing it from starting up? Interestingly, a colleague has the same problem with a web service that IS working on my machine, even though we are working with identical code. Something must be configured differently...
By the way, I've noticed that the 'Temporary ASP.NET Files' folder is missing from both
C:\Windows\Microsoft.NET\Framework and C:\Windows\Microsoft.NET\Framework64... I certainly haven't deleted them, and other web services debug okay, so is this just a red herring?
We are also on a domain which has its own firewall (outside of the developers' control) - could this be blocking it?
EDIT: I have just removed the user impersonation for a quick test, and it worked. So there must be something about Visual Studio 2008 that does not want to run when impersonating THIS particular user. Any ideas what configuration I would need to change to correct this?
I have had the same issues with impersonation; I don't know if Cassini (the built-in VS web server) supports this properly. About the best advice I can give is to either use Local IIS with an app pool running as your impersonated user or to attach your debugger using remote debugging to a remote IIS server.
I believe using Local IIS will attach correctly & automatically if configured as much in the Web tab of Project Properties. You'll have to run VS as an admin to get the virtual directories setup automatically by VS in IIS.

Visual Studio 2010 is not allowing me to debug my code

So, this interesting issue has been plaguing me for the past couple of hours. Visual Studio 2010 Ultimate no longer attaches the debugger and lets me debug my code.
If I use the built in development server, then everything works fine. If I switch to Use Local IIS Web Server (http://localhost/), then all it does it attach to w3wp.exe, but no DLLs or PDBs are loaded for anything. I can go to Debug > Windows > Modules, and literally nothing is loaded in this window. Conversely, when using the built in development server, the Modules window displays all the DLLs and shows that the symbols for my DLLs have been loaded. Something is obviously amiss. The VS installation is completely bone stock.
In IIS, my website is configured with ASP.NET 2.0 (because no 3.5 exists to select from the drop down), along with read / log visits / index this resource options checked on the "Home Directory" tab.
Some of my failed ideas:
1) If I attach to process on the iexplore.exe instance where the website is displayed, it loads Internet Explorer's DLLs, but not mine.
2) I've restarted the computer multiple times
3) I've invoked devenv.exe /resetuserdata once
4) I've confirmed that every project is indeed set to debug and not release.
5) Deleted all \bin contents and rebuilt the solution.
6) Deleted entire solution and repulled from Source Control.
Can someone tell me what is wrong with this thing? I'm going to have an aneurism from the headache this is causing me.
You need to attach it to the IIS worker process, which OS are you using? Make sure you attach with the Managed + Native flags, in the Attach to Process. What happens if you just run (F5) your web application inside Visual Studio (that automatically attaches a debugger)? Do you get any errors?
Well there are quite a few good answers here, but I have found that the root cause of the issue for me was application pool authentication configuration. Let me lay out the scenario that I experienced and the solution and perhaps it will help someone save time....and hair.
Scenario:
I want to debug an ASP.NET web application in Visual Studio 2010 but cannot use the built-in Visual Studio web server. The reason that I could not use the built-in web server is that my application referenced assemblies built specifically for a 64-bit architecture and the VS web server would not support these. So, I had to use the option "Use Custom Web Server" in the website properties to point the debugger at a published instance of my site on a remote IIS web server.
Issue:
Even with the web.config debug options set correctly to publish debug symbols in the assembly output (i.e. compilation debug="true"), the debugger would not attach to the remote IIS process and I did not hit any breakpoints
Environment:
The Visual Studio 2010 debugger was already installed on the remote IIS web server and was running as a Windows service under the LocalSystem account.
Solution:
Enable "Anonymous Authentication" in addition to "Windows Authentication" on the web site hosted on the IIS web server.
As soon as I enabled anonymous authentication, the correct symbols were loaded by the VS remote debugger and I was able to hit the breakpoints.
Hope this helps you guys out.
Have you tried deleting the browser cache? Sometimes the browser hangs on to old code which is incompatible with the current build and thereby prevents debugging.
Does it run the app - without the debugger attached? It smells like you are attaching the debugger to a wrong process
I've had an issue before where under the build configuration screen some projects are unticked for a particular solution configuration, causing them to not build and therefore not be debuggable. Can you confirm whether or not code changes you make are actually being built and executed?
Also, what version of Windows and IIS are you running? Is it possible that your process is running under an AppPool with an account that's different to the account you're logged in with and perhaps it's a permissions problem? If it's Vista/Win7, is UAC turned on and are you running VS as administrator? I'll also second the suggestion to try a fresh project and see what that does. Are you in the debugger users local group on the machine?

Categories

Resources