Started working this morning and quickly discovered Visual Studio 2017 debugging of my local IIS site has quit working on debug F5 startup. After a few hours of tracking things down I figured out that it is attaching to the wrong site, w3wp.exe process. I can manually attach and all is well.
If I stop the site that VS has this affinity to I get the standard ... Unable to start debugging on the web server. Unable to connect to the remote server'
Anybody know how Visual Studio chooses the w3wp.exe process that the debugger wants to attach to on debug starts?
Finally resolved after half a day of time spent and don't have an exact resolution. This project is a Web Site running on a particular port at same level as the Default Web Site. The fix was adding in the port to the project properties page 'Project Url' and removing it from showing up underneath the Default Web Site. I never thought the port was included in the project Url where the Virtual directory is created since original setup a few weeks back. If my memory is wrong then something removed the port from this Project Url setting.
I also noted that for some reason this site showed up in IIS Manager in 2 locations, under the Default Site as well as the site itself. When originally setup the Default Site was deleted and added back later but all had been working fine since then.
After more thought I also recall that the I discovered when the site did not first run in debugger it had been changed to run under IIS Express. I don't know why that happened unless I did seem sleep coding over the weekend.
we currently have 2 developers working on 2 different websites, on the same server.
when an error occurs in one of the web applications, that debug option pops up for the wrong developer. how do we specify what VS instance is to be used for which w3wp debugger process attached?
Here are a couple of options sorted from best to worst...
Run Visual Studio locally on the developer's computers so this isn't a problem.
On the server, use Visual Studio's web server instead of IIS. This gives each user an automatically created local process that can be debugged.
If you must use IIS, configure each application in IIS so that they run in their own application pools. Each application pool gets its own w3wp process so your Visual Studio instances can attach to their own process.
I'm trying to setup debugging on a class ASP project in VS 2010, and in doing that am trying to attach it's debugger to w3p.exe. I'm using Windows 7 64-bit and IIS 7.5. I've used this method successfully a few times before on another machine.
However, I'm finding that this time I am unable to attach the debugger. It's saying:
Unable to attach to the process. A debugger is already attached.
But I can't figure out what it might be. How can I determine this? Or could it be something else? I've rebooted my PC and can't yet see signs of anything running which looks like a debugger.
Setup
In case it helps, here's the steps I used to setup the environment, which I documented from my previous successful attempts:
Created new empty Visual Basic .NET Web (Best to create in C:\inetpub\wwwroot\, otherwise you will have security/ACL issues when loading the site).
Copied the contents of site folder to project folder.
In solution explorer, selected to show all files not in project. Selected all files and right click and select: "include in project".
Under project properties -> Web -> Set to use IIS and start with URL http://mysite.local
In hosts file pointed mysite.local to 127.0.0.1
In IIS setup new website pointing to the files with a host header of mysite.local
Go to application pools, ensured mysite.local was set to classic mode. No managed code.
Under ASP -> Enable Parent paths and make sure server-side debugging is enabled
Under error pages, make sure full details are shown.
Debugging in Visual Studio 2010
Run VS 2010 as Administrator
In your project, use Ctrl+F5 to run without debugging
Now, in the menu go to Debug -> Attach to Process -- This is where I fail
Tick show processes from all users AND show processes in all sessions
Make sure it is set to automatically determine type of code to debug
Look through the w3p.exe processes in the list, and based on the IIS POOL\site name, pick the right process.
Set your breakpoints and refresh -- debug as normal.
Are you having some Debug Diagnostics Tool running on your machine. Sometimes back i had the same problem the Debug Diagnostics Tool was debugging my w3p process.
I have installed the Visual Studio 2010 Remote Debugger on a Windows Server 2003 (x86) server, and am attempting to connect to it results in the following error:
Unable to connect to the Microsoft
Visual Studio Remote Debugging Monitor
named 'ServerName'. The Visual Studio
Remote Debugger on the target computer
cannot connect back to this computer.
A firewall may be preventing
communication via DCOM to the local
computer. Please see Help for
assistance.
I have checked my Windows firewall setting, and ensured file sharing is enabled on my local machine. I have ensured that DCOM is running on the server, as well as the debugging service. There are no actual firewalls involved that I know of.
What else do I need to change to get this to work?
I just ran into connectivity issue. The problem was the Client PC (my desktop) could connect to Remote Host running debug monitor, but the Remote Host could not send data back to my desktop.
Turns out that it was caused by the 'Profile' setup in Windows Firewall. The Firewall rule was being limited to 'Public' profile - but my desktop was connected to the local domain. Changing the setting to 'Domain' ensured the Remote Host could communicate debugging data back to Client desktop.
Check under Windows Firewall -> Inbound Rules -> Microsoft Visual Studio -> Advanced Tab.
Cheers,
J
Here are the steps I took to get remote debugging to work against an ASP.NET app. Not sure if you've done this already, hopefully something might help.
On my machine (call it DEVMACHINE from now on) I shared out the folder that contained the remote debugger (msvsmon.exe). On my machine, it was located at C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger\x86. I called the share msvsmon
On the server, I opened Windows explorer and navigated to \\DEVMACHINE\msvsmon, and ran msvsmon.exe (This opened the Visual Studio Remote Debugging Monitor)
On DEVMACHINE, I started Visual Studio 2010 and opened the solution that represents the application I'm attempting to debug.
In Visual Studio, clicked Tools > Attach To Process...
Entered the server name in the Qualifier field, then double clicked on the w3p.exe process that was in the list.
I then placed a break point in the location I wanted to start debugging
Couple things to note: The code deployed to the server was a Debug Build, the pdb files were there, along with the binaries. I had full admin rights on the server. No tools were installed on the server, I simply ran the exe that was located on DEVMACHINE. I did not have any firewalls between the DEVMACHINE and the server. And, both DEVMACHINE and the server are on the same domain.
Hope that helps.
I kept getting the same error listed above, and after trying all of the other answers, the problem turned out to be that DCOM was disabled on my development machine. The problem was solved by enabling DCOM using the instructions from this technet link.
I am using local DNS so I can test websites before they go live (by editing my hosts file).
I have a specific IP assigned by my router at home and at work.
i.e. dev.example.com is mapped to 192.168.1.123
When my machine changed to a different network without me realizing it could no longer reach the debugger and so I got the error.
Pretty obscure situation I had to get this error, which no amount of rebooting or recycling IIS will fix.
I had the same problems with the debugging service. The debugging service was starting automatically but I could never connect. I even turned off the firewall completely and that didn't help either.
Try running the debugging monitor (as opposed to the service) and connecting to that. You can find it in the start menu.
Confused about the difference between the monitor and the service? So was I. See http://social.msdn.microsoft.com/Forums/en/vsdebug/thread/afc80afc-c8eb-4831-915a-1edb8d188f98
Same problem here. My reason was that Trend security was enabled in the local computer, and it was blocking the firewall. I could not stop it because I needed a password, so I just deleted all the Trend processes, and it seemed to work fine. So you could check if some antivirus is enabled that is blocking the access.
I also needed to add devenv.exe to the Allowed Programs in the Windows Firewall in the local computer, and set its policies.
Below is a quick step to set up Visual Studio Remote Debugging Monitor on Visual Studio IDE.
Open Programs > Microsoft Visual Studio 2010 > Visual Studio Tools > Visual Studio 2010 Remote Debugger Folder.
A Windows Explorer shows the 32 and 64-bit versions of the Remote Debugging Monitor.
Copy the respective ver that matches remote server (e.g. x64 machine use X64 folder & x32 machine use X86 folder) to a folder on
your machine.
While at the console on your remote machine, go to the folder and start msvsmon.exe.
Go to Tools > Options and change the Authentication mode to No Authentication and check the box Allow any user to debug.
From your development machine, on Visual Studio, go to Tools > Attach to Process.
Change the Transport to Remote and the Qualifier to the name of your remote server.
You should now see the executable, which you want to debug on that list. Select the process you want to debug and click Attach.
You may now debug the code while it is running on the remote server.
Just remember to turn off Remote Debugging Monitor at the remote server once done.
Please refer below MS link:
https://learn.microsoft.com/en-us/visualstudio/debugger/remote-debugging-cpp?view=vs-2017
Many a time have I come across the issue of not being able to run debugging from within Visual Studio by hitting F5, and having to resort to attaching to a process.
For starters, lets assume the following
Visual Studio is running in an administrative context,
IIS7 is installed with IIS6 management options and Windows authentication enabled at a root level
You are an administrator on your local machine.
You are attempting to debug your web application which is running on said local IIS instance. The Web application project settings (Properties>Web) has been setup with the URL of the site
Hitting 'F5' results in an error from Visual Studio saying;
"Unable to start debugging on the web server. The IIS worker process for the launched URL is not currently running."
I've come up a blank after a couple hours trawling the web for answers, so I thought I would give StackOverflow a go.
If I get many good suggestions here then I thought it would be a good idea to start a checklist (which would hopefully turn into a wiki) of things one should try in order to get F5 debugging working.
"Unable to start debugging on the web server. The IIS worker process for the launched URL is not currently running."
This error message means that there is currently no ASP.NET worker process running on the host you are trying to connect to so the debugger cannot be attached.
Before hitting F5 make sure that
You connect to the right host (a problem might be 127.0.0.1 vs. host name)
There is a w3wp.exe process shown in Task Manager.
If the worker process is not running you can start it manually by opening one of the ASP.NET pages of your application.