I use Visual Studio Express 2012 for Windows Phone. When an error occurs during run time, I look in the Call stack window, but there are onlu systems functions there, and the last one, where the program stopped :
File : App.xaml.cs
Function : Application_UnhandledException
The function where the error really happened can never be found there. Is there an option to check to make this window display (if possible, only) usefull information ? Or is there another windows that should be used instead ?
Use the Exceptions dialog, set the debugger to Break on User-Unhandled Exceptions.
In Visual Studio's menu, Open Debug -> select Exceptions... -> check the first Checkbox for the Command Language Runtime Exceptions.
Edit: just notice that you are using Express version of 2012. As per the link,
To enable the Exceptions menu in Express versions, on the Tools menu, click Settings, and then select Expert Settings.
Related
Since this morning, I can't debug my console application anymore in Visual Studio. I've clean the solution, even delete the entire Debug folder but when I try to run in Debug, a new tab opens with the following message:
Source Not Available
Source information is missing from the debug information for this module.
You can view disassembly in the Disassembly window. To always view disassembly for missing source files, change the setting in the Option dialog.
There is also a pop up window saying:
Unhandled exception at 0x766FC69B (shell32.dll) in sfi.exe: 0xC0000005: Access violation reading location 0x00000004. occurred
My attempts so far
Following some comments, in the Exception Settings, I've unticked EVERY single exceptions, it didn't resolve anything.
I tried clicking on Continue but give up after the 30 consecutive F5 clicks.
Close VS 2017, log out, reboot, the bug is still there.
Anyone know how to get the Debug mode back in Visual Studio?
Is it possible to simulate non-UserInteractive mode when debugging in Visual Studio, and if so, how?
I have a service that is running that I'd like to debug, but the behaviour is different depending on whether I'm debugging it or running the service.
I found this question:
How do I debug Windows services in Visual Studio?
The answer there doesn't quite do it for me because following that, when you debug it, the debugger runs the process in UserInteractive mode. What I want is the debugger to debug the process, but without UserInteractive mode.
For example, I had an error that was buried deep in the code because a library it uses was trying to display some sort of dialogue box (even though the dialogue box wasn't seen by the user). This would not be picked up in Debug because UserInteractive mode is used. I want to be able to do more debugging on these kinds of issues
To debug a service you would need to
Build your service in the Debug configuration
Install your service to see how to do this go to this link https://learn.microsoft.com/en-us/dotnet/framework/windows-services/how-to-install-and-uninstall-services
Start your service either from services control manager, server explorer or even from the code and if you want to know how to do this then go to this link https://learn.microsoft.com/en-us/dotnet/framework/windows-services/how-to-start-services
Start visual studio as admin so that you can attach to system processes.
Optional > on visual studio menu bar, choose Tools, Options. In the options dialog box choose debugging symbols and select microsoft symbol servers check box, and then choose the OK button
On the menu bar choose attach to process from the debug or tools menu for the short key press CTRL+ALT+P
The process dialog box appears
Then select the show process from all users check box
In the available process section, choose the process for your service and then choose attach
Hope this helps
I hate attaching to a process from Visual Studio. It works, but it also seems to take forever to build the list of processes to choose from. Perhaps that's because our systems are locked down too tightly. It's entirely possible that in a different environment, this works just fine.
Still, I find it much easier just to trigger a programmatic breakpoint when the service is starting and jump in to debugging at the beginning. To do this, call the following in the OnStart() callback:
System.Diagnostics.Debugger.Break();
When you start your service, you should get a prompt indicating an unhandled exception has occurred.
Click the Yes option, answer Yes to the UAC prompt, select which instance of Visual Studio you want to use, and then debug normally once Visual Studio starts.
When you're finished debugging, just stop the service, and the debugger will quit automatically. However, don't close that instance of Visual Studio. Make whatever changes you need to make the service, and rebuild it. Then when you restart the service and you get to the point of selecting the Visual Studio instance to use, it'll include your original debug instance in the list. It's much faster to jump back into that one than creating a new instance each time.
HTH
How can i disable the "checking for solution" when a error occurs in my program?
What i want is that it directly goes to the error inside Visual Studio 2010. Now i have to wait like 1 minute before i can select debug and see my error.
Did not have this behavior before and not really sure what changed in the environmental settings.
I was debugging with 2 breakpoints when this behavior occurs every time a error happens outside the breakpoints.
This is a settings of the OS rather than of Visual Studio, to disable checking for solution feature on Windows 7 :
Click on start, type: Choose how to report problems, then change it to Never check for solutions .
If Visual Studio stops reponding it shows "Checking for solution".
At this stage VS is trying to fix the problem and promts to "send report" if user allows that.
It makes not so much sense to disable this, nor it is allowed in Visual Studio.
What if you put a tick on the check box:
Debug -> Exception -> Common Language Runtime Exceptions?
Does it stop immediately?
when i start visual studio 2010 c# .. and open my application i got this. it stopped responding and gives me that message in the picture once my application is opened but other application works fine.
then i debug visual studio 2010 .. and i got the exception
Unhandled exception at 0x76a0b9bc in devenv.exe: 0xE0434352: 0xe0434352.
EDIT: i tried to open the .exe file in project folder in debug folder and i got this.
how to fix that ? what should i do ?
thanks in advance.
Visual Studio is vulnerable to certain exceptions that are raised in design mode. Hard to categorize them, it is an immediate crash to the desktop. The exception code says as much, 0xe0434352 is a low-level managed code exception. You'd normally work around it by checking-in an earlier revision of your control and pay extra attention to code that needs to be disabled at design time by checking the DesignMode property. Your screenshot shows as much, seems like the control is actively displaying runtime info while in design mode. Risky.
If you want to debug it then you can by starting another instance of Visual Studio and use Tools + Attach to Process to attach to the first one (devenv.exe). Debug + Exceptions, tick the Thrown boxes for CLR exceptions and Win32 exceptions. Switch back to the first instance and load your project.
i've figured out what happened .. my form got 3 usercontrol that i made before.. one of those usercontrol has a customized progressBar which is a library .. for some reason that library stopped working .. so i removed it .. then added again from that usercontrol .. then the application worked.
I've started working on an old project, where WinForms application uses DevExpress controls, for example DataGrid.
The program window contains another multiple windows, and when I'm minimizing some of them, I get an Unhandled Application Exception with Attempted to divide by zero. in details. I want to know what causes this exception, but when I run the project in Debug mode in Visual Studio (2005 version), it does not react in any way to this exception.
Is there a way to find out the reason this exception is thrown?
Enable such exceptions in
Debug -> Exceptions -> Common Language Runtime Exceptions
Also
Also, it is a good idea to turn off the Tools-->Options-->Debugging-->Enable Just My Code option.