Unable to start debugging -visual studio 2012 - visual-studio

I have a solution where i have 8/9 projects.
everything was working good and suddenly, I started to get an error when I start to debug. and it says
Unable to start debugging.
If I close visual studio and run it again, it works in the first try.
and after that it stops working.
In the configuration manager it is set to "Any CPU".
I tried many thing with no luck. Is there any help??
this is how the error looks like..

I got similar error:
"Unable to start debugging. Check your debugger settings by opening
project properties and navigation to 'Configuration properties --> Debugging"
I have solved it by setting :
Properties--> Debugging --> Working Directory
to $(ProjectDir)

As it's an MVC web application, there's a couple of things to check. Firstly, are you sure the web project is set as your startup (this catches me and a couple of others in my office out from time to time)?
Secondly, where are you hosting the project? Are you using Cassini, or are you hosting it in IIS while you debug? If so, check IIS and make sure that the site is started, there's no issues with the AppPool, etc.
Finally, one way to try is to actually press Ctrl+F5 to run without the debugger attached, I often find that IE will then actually display an error that's causing the issue.

Related

msvsmon.exe crashed when debugging

When I debugging in VS2013 update3, msvsmon.exe crashed when hit at a breakpoint.
It shows "The debugger's worker process (msvsmon.exe) unexpectedly exited. Debugging will be aborted".
I'm not using remote debug.
Is it possible to shut down the msvsmon.exe to avoid calling it when debugging ?
Deleting all of the breakpoints solves the problem when I hit this error. Disabling the breakpoints was not enough - they had to be deleted.
I was able to attach to a process numerous times. Once I added a conditional breakpoint (with a few checks), I started getting this error when attempting to attach to that same process.
The error provided in the question is one problem. I also received an error stating that a debugger was already attached when I tried again. Either way, deleting breakpoints solved it.
Try turning on Options > Debugging > General > "Use Managed Compatibility Mode"
I got this error/crash too while debugging and trying to inspect a variable with 50 MB of text data in it. This option worked in both VS2013 and in VS2015 to allow me to debug and inspect the variable with large data.
A couple of things that worked for me:
Try Closing VStudio and relaunching.
If not, reboot helps.[I know thats generic, but its worth a shot]
Disable unnecessary break points.
I had this error also, and I too have Astrill installed. Completely uninstalling Astrill fixed the issue.
I reached out to Astrill support, and they answered (within 2 hours) saying the correct fix is to hold Ctrl and press the "Help" button on the Astrill application, and then choose "Uninstall LSP". This has fixed the issue without needing to un-install Astrill.
I don't know what LSP is, but I presume it's some sort of proxy.
In my case, it was caused by a VPN software. It changed my hosts file and my localhost was not 127.0.0.1 anymore.
So check your localhost in the hosts file (e. g. %WINDIR%\System32\drivers\etc\hosts) and make sure it is 127.0.0.1.
This error just occurred for me with visual studio 2015 RTM. Deleting all the breakpoints resolved the "The debugger's worker process (msvsmon.exe) unexpectedly exited. Debugging will be aborted" condition.
So If you clear all your breakpoints, in your version, you will not need to avoid using MSVSMON.exe.
I was using the OzCode debugger extension. Unfortunately they don't have a way to completely disable the extension - you can only disable certain features - so I had to completely uninstall it to confirm it was what was contributing to the crashes.
I got the same error. No effect after deleting all breakpoints and repairing Visual Studio (I have 2013 Community Edition). The problem was the Bitdefender software. I have Bitdefender Internet Security 2016 and had set Active Thread Control (Modules->Antivirus) to Normal level. But after setting this settings to Permissive the error doesn't show up anymore.
This error occured to me, when I tried to debug with Visual Studio / Service Pack 3, when Service Pack 4 was already released. After updating to the Service Pack 4 I was able to debug.
So, try installing the newest version of Visual Studio
Regards
This (or something that manifests in exactly the same way) is still an issue in VS2017. In my case it was caused by a dependency being too large to debug. The dependency in question was a generated client for a large REST API. I was able to debug again after slimming down that dependency.
Here's yet another answer: I changed my project from "Platform Target: Any CPU" to "Platform Target: x86". Went from needing about 5 attempts to debug to working every single time.
I had previously tried every suggestion in this thread: I reinstalled, I killed all breakpoints, and looked for fishy software interactions.
I started getting this exact error today in my VS2019 project. Attempting to expand/inspect simple data structs in VS debugger would make it freeze for a minute and then I'd get that "The debugger's worker process (msvsmon.exe) unexpectedly exited. Debugging will be aborted" message:
If I add msvsmon.exe process to windows defender exclusions list, then the problem disappears.
I hit this in Visual Studio 2019 (16.4.3) (C++) with a cause that I have not seen mentioned: I had accidentally added a Watch with incorrect syntax that was attempting to instantiate a singleton rather than returning the existing instance.
Repeatedly choosing right click > Clear All in the Watches view while debugging fixed the issue.
Fixed by changing Options->Projects and Solutions->Web Projects -> Use 64bit version of IIS......... to False.
In my case i am using the wcf Service on the wpf application and inputting parameters from here.The Wpf Application Execution on Facing this error "The debugger's worker process (msvsmon.exe) unexpectedly exited. Debugging will be aborted".
That case i am hosing the Wcf service and run the wpf application exe
In this type of Execution on I didn't Facing any Error like -- "The debugger's worker process (msvsmon.exe) unexpectedly exited. Debugging will be aborted"
please,try this proceed error solved because some execution process didn't supporting the debugging..... we are removing the Debuggers on also we face same error.
that case on helped this process.......
I just experience this with VC2017 Community Edition 15.7.2. Turning off the Microsoft Symbol Server lookup while debugging fixed it for me.
I've just had the problem in VS 2015. I hadn't noticed that one of my breakpoints was bogus - I had inadvertently pressed F9 to set a breakpoint when the disassembly window was showing in the previous debugging session. The solution was simply to delete that one bogus breakpoint - I got to keep all my others.
I tried almost every answer in here, but for my case, nothing worked.
Switching to 32-bit just made Visual Studio 2019 crash instead of msvsmon.exe crashing.
What did work for me is to set a very early breakpoint and use that opportunity to close the "Parallel Stacks" window. I didn't need that anyway, but it was open by default in my layout.
In my case, I had this error when I had the "Locals" tab opened during debugging and hitting a breakpoint. For some reason VS might've been unable to display one of the local variables. The error disappeared when switched to a different tab before hitting the breakpoint where the error was occurring.
My problems started after moving a project to a new folder. I wasn't having any luck with any of these answers using VS2019. I even deleted the entire .vs folder thinking maybe something got corrupted. No luck.
But on a whim I tried starting the project with CTRL-F5 instead of just F5 and that actually worked. It's consistent. CTRL-F5 runs fine. F5 gives me the msvsmon.exe error.
I have no idea what's going on, but at least I can get the project to run again.
This problem is at least 1 1/2 years old maybe more. Today is 6-11-22 and I have the problem in Ms Studio Pro 2022 with a fresh install of windows 11 not much of anything else in the computer. Then I uninstalled it and install Ms Studio Community 2022 put in 1 breakpoint at the beginning and I got the error.
Today 6-12-22 I reinstall Ms Studio Community 2022. For some reason I switch from x86 to x64 went through a about 1000 changes of errors and a crashed form1.resx file thank goodness for a backup I had or I'd be done again. anyways so far have several break points with no problems.
I deleted all my watch variables. That fixed the problem for me.
I know it doesn't directly address the error, but as a workaround, I'm using the Rider IDE from JetBrains, and am not encountering the error (code, system, etc. the same).
Visual Studio version: Professional 2017, 15.5.4
Rider version: 2017.3
None of the other answers worked for me, when I encountered this error. If you are not actually remotely debugging, you can use another editor until you figure out the problem or it resolves itself (the latter was the case for me).

Cannot debug web projects anymore "invalid pointer"

I haven't been working on web projects for a while but last time I did debugging was working just fine.
I have worked on some console apps recently where debugging is working fine. I now went back to a SharePoint 2010 project, set a break point and hit F5 but first got this prompt:
I click OK and next prompt is
I also tried to attach to process (w3wp.exe) instead of F5 but no difference
I tried to disable IntelliTrace but then got
I tried to repair .Net 4.5.1 in the control panel
I tried to repair VS2012 in the control panel
I tried to create a new project but same error
Since debugging is working fine for console apps I guess it's something with IIS/web.config but not sure if it has changed since last time I looked at this project.
Any ideas?
Thanks in advance.

VS2010: "Unable to start debugging"

My VS2010 debugger has stopped functioning suddenly today on my Dell M4500. I had reinstalled VS2008 SP1 last week, but the 2010 debugger ran fine since then, so I'm not sure its the culprit.
I can launch a project once just fine, & afterwards I get a message that reads "Unable to start debugging," without any error # or explanation of why. Doing IISRESET doesn't help, I get the same message until I close VS with the entire solution and reload it. Here are some things I've tried:
Verified I have the latest project files
Repair option for VS2010
Complete uninstall/reinstall VS2010
Replaced Web.config with known good copy
Added localhost to the list of trusted sites in IE
Performed \aspnet_regiis -i in the 2.0 & 4.0 directories
Through IIS Services Mgr -> Default Website:
verified Enable HTTP Keep-alives checked
placed check in Integrated Windows authentication
Ensured Debug on "Any CPU" is selected
Tried building to Platform targets "Any CPU," "x86" & "x64"
Added DisableLoopbackCheck registry key entry in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
Tested under both IIS & VS Development web server
Does anybody have any suggestions I can also try? Any help is very greatly appreciated!
Just a side note. I got a similar error in VS2013 trying to attach to chrome the error was:
Unable to attach the application 'chrome.exe' using XXX The 32 bit
version of the visual studio remote debugging monitor (msvsmon.exe)
cannot be used to debug 64 bit processes or 64-bit dumps. Please use
the 64-bit version instead
I had to untick "Silverlight" in the web project Web section:
I received this same message, preventing my web project from running and opening in a browser. Turns out another developer had made a change in the project properties to "Use Custom Web Server" which pointed to an external URL instead of to the web server on my machine.
Try this:
Right-click your project in Solution Explorer - click Properties - click Web tab - under Servers click "Use Visual Studio Development Server". For reference the usual port value here is "Auto-assign Port". Best of luck.
Here's why I got this error.
In Debug properties, verify that Start external program is not empty.
VS 2010 will warn you about it being empty, but will let you save it
I was trying to switch it from IE to Chrome, lost track of changes I was making, and spent an hour trying to figure out where this error was coming from.
I had the same issue but it worked when I switch Build => Platform target from x64 to x86.
Kindly turned off Debug Edit and Continue option
Turn on vs2010, run debug.
turn off debug, shut down all lunched webServers (i had few of them for different services)
Turn off VS2010
Turn on VS2010.
After that everything works perfect.

Visual Studio detaches from application as soon as debugging starts

I have a web application that I've always been able to run in Visual Studio and it debugs just fine (breakpoints work, I can pause execution, etc). Recently, the behavior changed suddenly, and a few things happen:
I start debugging, it lauches IE and loads the application, but after a few seconds (sometimes the page hasn't even displayed yet), Visual Studio acts as if debugging has stopped - I'm able to edit code in VS again, and the "Play" button on the toolbar is enabled. The application continues to run in the IE window just spawned, but I'm not attached to it
During this few seconds that VS is "debugging", because it detaches, my breakpoints show as hollow - as if I'm set to "Release" mode and they won't be hit. In fact, I have a breakpoint set in Page_Load, and it skips right by. I've checked, and I'm set to debug mode, though the compile mode dropdown is missing from my toolbar (I checked in the build properties to ensure I was in debug mode).
Can anybody shed some light here?
It turns out that this was actually a result of an upgrade to Windows Vista. VS wasn't being "Run as an Administrator", which caused it to lack the rights to attach to other processes for debugging. As a result, debugging would stop right after it started. Changing the VS shortcut to run as an administrator resolved this problem.
I've experienced samely looking behavior. The cause was in existence of several <system.web> sections (which is allowed by web.config schema). Visual Studio debugger (versions 2008 and 2010 were tested) looks in the first encountered section only. So if your <compilation debug="true"> tag is not in the first one, it thinks that there are no compilation.debug setting present and genrally tryes to add <compilation debug="true"> to the first <system.web>. In some cases VS2008 just silently procceds in this case. For example look here: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=510354#details"
Have you installed anything else on the server / workstation recently?
We have a third party app that doesn't allow us to debug, w3wp.exe crashes immediately upon an attempt to debug.
I ran into something similar when I had placed some code in a constructor that was crashing. Exact same issues where the Debug would disconnect just after the application started up.
The short if it, check that you haven't configured a class constructor to run during web startup that is crashing...
Quick windows 7 update: I had to add "localhost" to my list of trusted sites to correct this issue...go figure.
Just a workaround for those (like me) for whom the above solutions do not work: After starting the app you wish to debug, go to Debug -> Attach to Process, and attach it to the process you want to debug. Works on my machine.
In my case, I faced this issue with Visual Studio 2019 and 2022 as well.
I tried upgrading/downgrading Visual Studio versions but nothing helped.
On debugging, I finally found the root cause and sharing it here to help others facing the same problem.
I was using Brave browser with Visual Studio and whenever I uploaded a file in my application, the Visual Studio debugging stopped automatically. The root cause of this issue is the feature in Visual Studio to stop debugging on closing the browser. With Brave browser Visual Studio feels like we have closed the browser on uploading the file. So to fix this issue I have turned of this setting as given here.
You can find this setting here
Tools > Options > Projects and Solutions > Web Projects > Stop debugger when browser window is closed, close browser when debugging stops
Just turn it off and everything should work fine.

Visual Studio Hosting Process and "The operation could not be completed"

When trying to execute from within Visual Studio 2008 your application and you get the (uninformative) message "The operation could not be completed".
The solution to this is to turn off the "Visual Studio Hosting Process".
The problem with turning off this "hosting process" is that all the "run and rewrite" functionality is no longer available. OK, so this isn't a big deal, but I'm always getting this message no matter what machine I use (and it might be nice once in a while to use the rewrite and execute functionality).
Am I doing something wrong? How come this "feature" within VS seems to complain so readily? Do other people have success with enabling the hosting process and making use of it?
The problem with turning off this "hosting process" is that all the "run and rewrite" functionality is no longer available.
The Visual Studio Hosting Process is not needed to allow Edit and Continue. It is used for "Design time expression Evalutation" in the case where the project is a dll rather than an EXE. It is also used to provide debugging for partial trust scenarios. See the documentation for everything it does.
It is highly unlikely it does anything you need, so don't feel bad turning it off.
Is your project output folder set to a network share?
If so, try changing it to a local folder and see what happens. It appears that VS is not always able to terminate the process if the host exe is running from a share.
The other possibility is that the project is open and running in debug mode on another instance of Visual Studio - although I suspect you will allready have ensured this is not the case.
I honestly have never seen this message and I work with Visual Studio for at least 8 hours a day. Is this reproducible on other machines? If so is there anything weird or abnormal in your code that could cause this to crash?
I use 4 different machines and have got this situation on all of them. I understand what is causing the problem - it is that the VS hosting process isn't terminating after the first debug session ends, which means that the next time that you try to compile the exe the hosting process is locking the exe and preventing compilation. Another solution therefore is to use Task Manager to kill the VS hosting process and compile and debug as normal but thats even more of a hassle!
I can't think that its anything in my code that would be causing this - its probably a VS issue itself isn't it?
Here's the anwser: disable "Enable he Visual Studio hosting process" in he debug tab of your projects properties.
I found it here:
http://social.msdn.microsoft.com/Forums/en-US/vbide/thread/40d2d241-a0c0-4137-9da9-e40611972c0e/
There are several causes and workarounds regarding to this problem and you might try the following ones that are useful most of the time:
Delete the "Your_Solution_FileName.suo" file and restart Visual Studio.
or
Right click on the project and select Unload Project and then click Reload Project by right clicking on the project again might also fix it.

Resources