Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSVSMON.EXE very slow debugging with VS

I'm trying to debug an ASP.NET web application from Visual Studio 2013, with IIS 7.5 on a Windows 7. The debugging process is extremely slow, taking about 60-90 seconds per page load. I've noticed that, while a page is loading, MSVSMON.EXE (Visual Studio Remote Debugging Monitor) stays on 25-30% CPU on my Quad Core machine, and I suspect that it is the culprit.

On another PC with Windows 8 and IIS 8.5, debugging is much, much faster with almost meaningless MSVSMON usage. I tried to mimic every single debugging settings for Visual Studio and IIS for the former machine, yet the debugging is still very slow and MSVSMON stills reaches high cpu usage.

Why is that so? What can I do to solve my problem and reduce that CPU usage?

like image 748
David Jiménez Martínez Avatar asked Apr 02 '14 14:04

David Jiménez Martínez


People also ask

Could not start debugging on the web server?

Open your project properties and make sure that the project is configured to connect to the correct Web server and launch URL. (Open Properties > Web > Servers or Properties > Debug depending on your project type.) If that does not work or you are debugging remotely, follow steps in Check your IIS Configuration.

How do I debug a remote process in Visual Studio?

You can attach the Visual Studio debugger to a running process on a local or remote computer. After the process is running, select Debug > Attach to Process or press Ctrl+Alt+p in Visual Studio, and use the Attach to Process dialog to attach the debugger to the process.

What does msvsmon Exe does not appear to be running?

Error: The Microsoft Visual Studio Remote Debugging Monitor (MSVSMON.EXE) does not appear to be running on the remote computer. This error message means that Visual Studio could not find the correct instance of the Visual Studio Remote Debugging Monitor on the remote computer.

Why is my Visual Studio remote debugging monitor not working?

There are many reasons that may cause this error, please refer to this document: Error: The Microsoft Visual Studio Remote Debugging Monitor (MSVSMON.EXE) does not appear to be running on the remote computer, and check the debugging environment on your side.

How do I run a remote debugger in Visual Studio 2015?

If you want to configure the remote debugger as a service, follow these steps. Find the Remote Debugger Configuration Wizard (rdbgwiz.exe). Start running the configuration wizard. Check the Run the Visual Studio 2015 Remote Debugger as a service checkbox. Add the name of the user account and password.

Why is Visual Studio not debugging in debug mode?

Please see Help for assistance on configuring remote debugging. Visual Studio is being prevented to get in debugging mode. There are two possible reasons: Remote Debugging is off.


2 Answers

I experienced this when I set a conditional breakpoint in code that was run frequently. Attempting to pause the debugger simply caused Visual Studio to... do nothing (other than grey out the pause menu option).

Visual Studio Remote Debugging Monitor was taking up about 30% CPU on a quad core system.

Removing the conditional breakpoint resolved the issue.

like image 120
Eric J. Avatar answered Oct 08 '22 00:10

Eric J.


Are you debugging the same application on both machines? If not, one thing to check is how many exceptions are being thrown with the II7.5/Windows 7 app vs. the win8 IIS 8.5 application - the debugger does quite a bit of work for each exception so has a magnifying effect on the slow-down.

If that is the issue you can try turning off debugging->output windows->exception Messages which should help some. Of course if you've got an application that is throwing enough exceptions to cause that kind of slow down and you have the ability to re-work the code to reduce the number of exceptions thrown in non-exceptional circumstances, that would help as well.

Failing that, you might try turning off all the output settings and IntelliTrace as all of those things potentially affect performance and if that solves the problem you can turn them back on one by one to figure out where the culprit is - even if they are identical applications enough changes under the hood between version that the events the debugger has to handle may be substantially different.

HTH

like image 37
David W Gray Avatar answered Oct 08 '22 01:10

David W Gray