Visual Studio 2017 Enterprise Diagnostic Tools no longer shows events at all - debugging

Okay so it appears in the last week or so my Enterprise Visual Studio 2017 can no longer get the 'Events' to populate at all for the Diagnostics tool. The tool shows up and runs just fine, it however does not have any events even as I can see and when clicking the filter. Except funny enough it can load symbols and still hit breakpoints and even tell me: "Yep I got your breakpoint event". The problem being I used it a lot for ADO.NET and data tracking to double click an item and get the 'historical debugging'. Basically the 'Filter' says I don't have events yet and even if it hits a breakpoint it only acknowledges the one event.
Things I have tried:
Deleting the SUO files for the solution I am on.
Checking the Debug General Options against another Dev whose is working. And ensuring 'Enable Just My Code' is on.
Changed Configuration settings from Debug to Release and changing CPU configs to see on the off chance this could be it.
Shut down the PC and rebooted.
I tried suggestions on this thread:
Visual Studio 2015 diagnostic tools no longer working

In your screen shot, it just has the break events, no IntelliTrace Events.
(1) Please add a breakpoint in your app, and then debug it, after the breakpoint was hit, check the Event.
(2) I think you could enable the IntelliTrace under TOOLS->Options->IntelliTrace, please enable IntelliTrace. Debug it again.
(3) Of course, not very sure that whether it is related to the project type, for example, just create a simple Winform app, test it again.

Related

Data Tips in Visual Studio on Release Configuration

How can I get Visual Studio 2017 to display data tips while running in Release Mode rather than only in Debug Mode?
Data tips are the tool tips that pop up when hovering the mouse over a property, variable, etc. while paused on a breakpoint.
I've read that these are only displayed while running in "Debug" configuration, but for one of my current projects, the program will only run correctly while in "Release" configuration. This is making it extremely difficult to debug anything.
UPDATE:
Today it started working for me without me having changed anything.
The only explanation I have is that on the previous night I switched to Debug mode, built the application (which failed with errors), then switched back to Release mode, and built again. When I ran the application the next morning, the data tips were back.
(1) Disable Optimize Code option under your project properties.
(2) Enable Use Managed Compatibility Mode under Tools->Options->Debugging->General.
And then debug your app in release mode, check it again after the Breakpoint is hit.
(3) Maybe it was related to your project files, so you could re-open your project, view it again.

Visual Studio 2015 does not hit breakpoint when debugging WF workflow

Visual Studio 2015 does not hit the breakpoint that I set when debugging WF workflow. Are there any settings that I have missed?
Steps to reproduce:
Create new workflow console application
Create workflow, e.g. just a WriteLine activity
Set breakpoint on activity in workflow designer
Hit F5 to run in debug
This works fine in VS 2012 and 2013, so I am thinking that either I am missing a setting or there is a bug...
Solved by disabling "Just my code" in debug settings. In my opinion the workflow is "my code" though...
I have bumped across this issue multiple times where Workflow does not hit the breakpoints in the designer. This is not something specific to VS 2105, since I have encountered this with VS 2013 also.
As a resolution, You will need to move any random control in your workflow, save, build the solution and then give it a try. The root cause of the problem is that there are scenarios when the debug symbol line in the XAML does not update, and hence Workflow is not able to identify recent changes.
If you are able to recreate this issue again, check the debug symbol line in the XAML file & you will find that it did not update. Once you just move any control on the workflow, the debug symbol should be getting updated and your breakpoint will be hit in the designer.
Let me know if this does not resolve this problem.
When "Just my code" is disabled (unchecked) then step into (when debugging code) does not work.
In documentation you can find a warning box with text:
Ensure that you select the option Enable Just My Code (Managed Only) from the Tools, Options, Debugging menu before you debug. If you have two sequences nested within another sequence and you set a break point on the first inner sequence, pressing F11 will not debug into the second inner sequence if the Enable Just My Code (Managed Only)option is not selected.
https://msdn.microsoft.com/en-us/library/dd489405.aspx?f=255&MSPPError=-2147217396

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."

How to stop "Just In Time Debugging" messages blocking a buildserver

Our buildserver (TeamCity, much recommended), runs our a whole bunch of testsuites on our finished c++ program.
Once in a whole, a test causes our program to crash, often bringing up a VisualStudio dialog offering me to JustInTime debug the crash. The dialog stops the buildserver from progressing. Instead of the build marked as failed, it just hangs. I've turned off the Just In Time debugging feature in VisualStudio, but when it's turned off, you still get a message "Couldn't JustinTime Debug this, you can turn it on in the options".
Does anybody know of a way to ensure that any unhandled exception in a program does not result in any modal dialog?
This MSDN article explains how to disable Just-In-Time debugging on a Windows server. I've included the relevant portion of the article below:
After Visual Studio is installed on a server, the default behavior when an unhandled
exception occurs is to show an Exception dialog that requires user intervention to
either start Just-In-Time debugging or ignore the exception. This may be undesirable for
unattended operation. To configure the server to no longer show a dialog when an
unhandled exception occurs (the default behavior prior to installing Visual Studio), use
the registry editor to delete the following registry keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\DbgManagedDebugger
On a 64-bit operating system also delete the following registry keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\DbgManagedDebugger
Delete (or rename) c:\windows\system32\vsjitdebugger.exe.
I tried deleting the registry keys, and I tried unchecking all the boxes in the Visual Studio options, but neither worked.
To be clear, my situation wasn't a C++ one. I was using Micro Focus COBOL for Visual Studio 2010, and by using the registry and VS options suggestions I managed to get rid of the "Want to debug?" dialog, but that resulted in a different dialog to hold up my automated process:
Visual Studio Just-In-Time Debugger
An unhandled exception ('COBOL runtime: Fault detected') occurred in CASDBC.exe [3564]. Just-In-Time debugging
this exception failed with the following error: No installed debugger
has Just-In-Time debugging enabled. In Visual Studio, Just-In-Time
debugging can be enabled from Tools/Options/Debugging/Just-In-Time.
Check the documentation index for 'Just-in-time debugging, errors' for
more information.
OK
I would not recommend to edit/remove regs. Usually the registry is a mess to play with.
The solution that helps me is a quite simple. I`ve just added JIT debugger to my Visual Studio. Steps are:
Open Windows Control panel
Programs
Programs and Features
Find Visual Studio 2017
Click Change. On a new opened window navigate to the Individual Components tab
Check Just-In-Time debugger checkbox
Click modify
After VS reload the error should be fixed.
In my case , on win2012 server, I tried:
removing registry keys
deleting the exe for the jit debugger from c:\windows\system32
and it still came up!
I rebooted, etc.
Was making my web site in IIS stall until dialog was acknowledged!
Final solution, which did work: In control panel, in Programs: Uninstalled "Microsoft Visual Studion 2010 Shell (Isolated)" Uninstalled that, and problem solved.
(Whether SQL Management Studio still works.... I do not know!)
In the Window for the question
Do you want to Debug using the selected debugger?
Click YES (new window opens) > OPTIONS (top row menu) > DEBUG
Then in the New window remove the TICK which shows ENABLE JUST IN TIME DEBUGGER.
After disabling the JUST IN TIME debugger close the window or click OK
Your problem will be solved. I've tried this and got rid of the JUST IN TIME POP UP messages.
Best Solution for this problem is so simple
2 steps to make it done
open cmd prompt
type : regedit
go to path-->HKEY_LOCAL_MACHINE-->SOFTWARE-->Microsoft-->Windows NT-->CurrentVersion-->AeDebug
You can find now the file : Debugger
right click , Modify
copy and paste this text inside it:
drwtsn32 -p %ld -e %ld -g
click ok and voila :)

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