Browser keep stopping with user breakpoint and opens visual studio 6 in debug mode - visual-studio

Following my last question (see: Problem in hosting ActiveX on Vista (in a Visual Studio 6 C++ application)) I ran into a strange problem. I hope this’ll be a simpler issue to the experts here:
Each time I run certain application like iexplorer or firefox, the Visual Studio 6 suddenly opens up in debug mode with a message “User breakpoint called from code at 0xSOMETHING”.
I can press F5 to continue but the applications run slowly and needless to say I have no wish to debug these applications…
My guess is that when I worked on my VC++ application I placed breakpoints at windows methods like CAxDialogImpl::Create(), AtlAxCreateDialogA() etc’, and for some reason it was kept somewhere.
Of course I now removed all the breakpoints and re-compiled the project but still this keeps happening!
I checked in the tools->options but the “Just-in–time debugging” is not marked.
Any idea?
(I use Visual Studio 6 which I installed on Vista)
Thanks a lot,
Erik

Not sure this helps but anyways:
Try disbaling the default debugger option. (It says Dr. Watson but it depends what you have set as the default debugger)
http://www.bridgetonova.com/2007/09/how-to-disableenable-windows-default.html
Also as per this post Visual Studio 6 is not supported on Vista. Only Visual Basic is.
http://www.itwriting.com/blog/167-visual-studio-6-on-vista.html

You should probably re-ensure yourself that you have removed all calls to DebugBreak() and manual break-points. Also try to ensure that when you recompile you re-register everything to point to the right places (i.e. the activex pointed to by the guid in the registry is actually the latest recompile).

Related

Visual Studio 2010 hangs on attach to process / debugging

Whenever I try to debug a Visual Studio 2010 web project, VS hangs, and ultimately crashes. This happens if I try to start the project using F5, or through Attach to Process, before the process list even appears.
Hitting F5 in, for example, a Windows Form project works fine, but attach to process fails here too.
Any ideas on what can be causing this? Obviously attaching to the devenv.exe process won't work as I can't get the Attach to Process dialog to appear...
Oh, running W7 (x64), VS2010 SP1 (had same problems without SP1)
In Solution Explorer there is a Show All Files icon (highlighted in the photo below):
Make sure it's turned off,
When It's turned on, Visual Studio tries to index all the files in the solution and if you have a giant Solution it could take forever!
I hope this has helped someone :)
Have you recently installed Mono and/or Mono Tools for VS2010?
I found that to be the problem it my case. Not sure why, but it somehow got in the way.
Matthew
In my case hangs when executable type was not correctly set, ex. Managed v4.0 and trying to attach to Native.

Not hitting breakpoints attached to NUnit

I'm using the latest NUnit, 2.5.9, on Windows 7 64-bit, Visual Studio 2010 Premium, and the projects are .Net 3.5.
The problem is that I attach to NUnit (there is NOT an nunit-agent appearing), and symbols are loading, but my break points aren't being hit. There is no error indicator next to the breakpoint indicating something is wrong.
The first run seems to take some time to start the test, but subsequent runs after that seem to complete almost instantly. I assume because StructureMap (required for the objects i'm testing) has already done its thing and doesn't need to repeat that setup.
Any ideas on how to fix this?
I sort of figured out the answer. I reset all of my settings to the standard Visual C# Development Settings and debugging suddenly works again.
I'm not sure which setting got everything back on the right track; I didn't see a "disable debugging while debugging setting."

Visual Studio Debugging Issue

Seeing an issue when debugging in Visual Studio. All of the values under watch, and in the hover over window show up incorrectly. the only values that show properly, are values that are local to the method I am currently stepping through.
For example the watch value for 'this' when debugging shows the following under value
0x00000000ffac0388 { btnBack=0x00000000ffaccf20 btnReply=0x00000000ffacd200 btnForward=0x00000000ffacd420...}
some other variables show this, even though the variable is there.
error: 'this.foo' does not exist
The machine recently had windows 7 64 installed, since then this problem has occured.
Visual studio has been reinstalled on this machine, and we verified that the settings in visual studio were exactly the same as a different PC that is the same machine and config.
We finally figured out what the issue was. The devenv.exe was being set to run in xp compatibility mode (sp3). Doing a rebuild of the project after removing the compatibility mode fixed the issue.
Can you provide a bit more information to help us track down this problem. In particular
What operating system was installed before upgrading to Windows 7 64 bit?
Did you install Visual Studio before or after the upgrade?
Is there any other version of Visual Studio installed on the machine?
If you set your application to be x86 specific does the problem still repro?
What language is your code written in (assuming C#)?
When facing weird debugging issues, I find that deleting the solutions User Options file (.suo) usually fixes the problem. You will loose your bookmarks, breakpoints, any special exception handling, and so on.
If that fails then clear all your Visual Studio "temporary" files. Check out the "Clear Recent" script at http://missico.spaces.live.com/blog/cns!7178D2C79BA0A7E3!370.entry. Modify it for your own needs. For instance, I dislike Flash, so you may want to remove the call to ClearStupidFlash and the other non-Visual Studio calls. Clear your solution then "rebuild all".
If the problem still exists, then something else is going on.

Debugging in visual studio 2008 freezes entire system

Any time i try to debug in visual studio 2008 my entire system will freeze whenever a breakpoint is hit.
I can move the mouse around and that remains responsive but nothing i click on does anything,
I can bring up the task manager but can't do anything with it and i am able to lock/unlock the machine.
I tried a fix that i found via google that suggested i disable advanced text services but it didn't work. I am using visual studio 2008 with SP1 running on Windows XP Pro, asking here is my last hope before formating/reinstalling so i hope someone can help me out.
I debug by running the application in debug mode, the freeze happens no matter what the project size and it seems as if it is just the entire GUI that freezes, the computer carries on working just fine i just can't do anything with it because the GUI is totaly unresponsive.
I found I only had this issue when I was using the keyboard to debug. If I used the toolbar debug buttons, I didn't have an issue.
To "fix" this, I set the LowLevelHooksTimeout to 300ms (from 5000ms). You may need to add the DWORD if it isn't already there.
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\Control Panel\Desktop\LowLevelHooksTimeout
HKEY_CURRENT_USER\Control Panel\Desktop\LowLevelHooksTimeout
Restart after making this change for good measure.
How big is the project you are running? When I did a Find last night on a huge open source project, I got kind of the same behavior.
Also, did you try Uninstalling just VS2008, then Reinstalling with only the options you use.
Have you tried disabling "Call ToString()" debugger option? This is ON by default, and is known to deadlock.

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.

Resources