Getting helpful error messages on Windows 7 - c#

During Windows XP development, if my application encountered an unhandled exception it would display an error message "X has encountered and error..." and give me the option to launch the debugger. Under Windows 7, all I get is a message that says "X has stopped working, Windows is checking for a solution".
I can no longer see any details of the error message and I'm not given the option to debug.
I'm using VS2005 and JIT debugging is enabled as far as I can tell.
Is there anyway to get back to the useful error messages of WinXP?
Edit: It is just a standard WinForms desktop application, requiring no special permissions to run.

Maybe you find the WER (Windows Error Reporting) settings useful:
http://msdn.microsoft.com/en-us/library/bb513638%28VS.85%29.aspx
Also, you can use this as a landing point to get in touch with WER:
http://msdn.microsoft.com/en-us/library/bb513641%28v=VS.85%29.aspx
Unfortunately I can't directly answer your question, but perhaps this can serve as a hint for further researching.

OK, found an answer thanks to the comment from leppie.
Go to Control Panels->Action Center
Expand the Maintenance tab and select Settings under "Check for solutions to problem reports"
Change to "Never check for solutions"
Now when the error occurs there is a "Debug the program" option in the dialog.

Related

mono - the requested feature is not implemented - what feature?

I'm receiving this error when I start my application but I have NO idea what feature isn't implemented. It doesn't print anything to the console or tell me what isn't implemented.
Is there a way to figure this out? The only thing I have to go on is this error message that appears in a window:
Interestingly enough my application does start after I click ok, but I'd like to figure out what the problem is.
Minimize to systray is my first guess. That wasn't implemented last time I looked.
But you might be able to find a stack trace in Windows' Event Viewer -- Application Log

How to find source for win32 exception "error creating window handle"

I'm looking for a little help regarding the win32 exception "error creating window handle".
From time to time our program (WinForms - C#) throws this exception and sometimes the windows even freeze, so that the users have to kick the process to be able to work again.
From the many other threads regarding this problem, I know what I should be looking for, but not extactly where as our program is quite big. So I was hoping that there might be a way to restrict the codelines I have to check... Are the any tools, which can help with this exception?
Short update: I solved the problem.
ProcDump didn't help me much, because I got pretty the same information from our logfiles. However, I was able to reproduce the error in our development environment. Thanks to debugger and displaying the user-objects count in the taskmanager I found the source of the memoryleak - an undisposed texbox which was created dynamically.
Thanks again for the tips!
If this issue happens inside the debugger, you can set the debugger (I will assume Visual Studio as you're using C#?) to break on throwing an exception. In your case you would want to set an exception breakpoint on (I think) System.ComponentModel.Win32Exception.
Again assuming Visual Studio as your IDE, on the "Debug" menu is an "Exceptions..." item. This allows you to tell the debugger to break when specific exceptions are a) thrown, or b) unhandled.
Under Common Language Runtime Exceptions, expand System.ComponentModel, and enable the checkbox in the Thrown column for System.ComponentModel.Win32Exception.
Then just carry on as normal. If during debugging the exception occurs, it should break into your program and allow you to see where it's happening.
Edit: If you can't reproduce the problem on your development machines, see if you're able to set up the target machine to produce a dump when a crash occurs. One way of doing this is to run ProcDump. Run it with the -e parameter to create a dump in the event of an exception. Then you can analyse this back at the ranch.

Debugging Silverlight in Visual Studio 2010

I have an MVC application which uses a silverlight control.
Somewhere along the line something is happening in the silverlight cs code that isn't right. I've inserted break points in the CS silverlight code to get a better idea of what's happening, but for some reason I just can't step through the code.
I know code is being hit, but it's just not showing me in the debugger.
I thought it might be because I was using Chrome as the default browser but I changed this to Internet Explorer and still no joy.
I realize this is a very vague question, but has anyone else experience anything similar, and if so, how did you get around it?
Any help would be appreciated,
Thanks.
Be sure to set the Silverlight Debugging checkbox on the project properties Web tab
If Chrome is your default browser and your breakpoint tooltip shows this message:
"The breakpoint will not currently be hit. No symbols have been loaded for this document"
... then it is possible the debugger attached to the wrong Chrome process at debug startup. A work-around is:
Start debugging your Silverlight app. Your app should be running in Chrome.
From the Debug menu, select Attach to Process...
Scroll through the available processes and locate the chrome.exe process that shows the type as 'Silverlight x86'.
Select that process and click Attach.
I had firefox as my default browser and nothing was being hit(I even tried attaching to a process). What finally worked for me was setting IE as the default.
Silverlight break points are now being hit for me! :)
Right Click on Web.UI project in solution. go to Web , check Debuggers --> Silverlight save and Debug..
Make sure you have silverlight developer installed.
Your code may be part of a class marked with the System.Diagnostics.DebuggerStepThroughAttribute. This happens with auto generated classes (like with Add Service Reference). If you are extending a partial class, other parts of the class definition may have that attribute.
Try unckecking the Options / Debugging / General / Enable Just My Code checkbox.
Otherwise put your mouse over the red dot in the source code window, which becomes an empty circle if the debugger disabled it, a tooltip will give you additional information.

Completely remove "error list" from visual studio

I want to completely remove "error list" from visual studio 2008, not disable it i want it gone. It annoys me to no end popping up endlessly, i guess i must be "doing it wrong" but w/e i just want to use VS without being alerted every other keystroke about some warning.
I've tried editing many different fields in the options (tools -> options) it has only slightly decreased the frequency of the error list popping up. I have also deselected errors, warnings, and Messages. and it pops up with nothing to display. unpinning it doesn't help either.
also upgrading to VS 2010 is not an option at this point.
Im looking for a solution something like the following: remove a dll or config file responsible for this
Also I still want the inline validation (the little squiggly marks, etc), but
the error list window annoys me.
I think this is probably exactly what you're wanting:
http://blogs.msdn.com/b/zainnab/archive/2010/05/16/hide-or-show-error-list-when-the-build-finishes-with-errors-vstiptool0022.aspx
You can change this behavior by going to Tools -> Options -> Projects
and Solutions -> General and deselecting the "Always show Error List
if build finishes with errors".
I'm guessing this will work with ASP.Net as well, since that's building on the fly.
I am using Visual Studio 2017, and I also have to cope with the useless, impossible-to-disable, annoyingly-in-your-face, and outright disturbing "Error List" window.
So, here is what I did:
Undock the "Error List" window to make it free-floating.
Resize it to the smallest size possible.
Move it out to some remote area of the screen where it is not so annoying.
And voila, problem solved ! (*1)
*1 Well, problem mostly solved. It will be completely solved when I abandon this dinosaur of an IDE.
My 'Error List' was constantly displaying also (VS2012). I also hate it.
I turned it off years ago, but today it just started appearing.
It was being caused a unreadable packages.config file. For some reason that reports it's fail state through the yukky 'Error List'.
Fixing the packages.config file stopped the 'Error List' from appearing.
for VS2017, select the "Build only" value from the drop down list in Error tab. Refer to the image below:
Hope this helps!
On Error tab, you have Errors / Warnings / Info buttons. Click on Errors button (de-press).
hope it helps.
I suggest turning off inline validation.
Yes, I know that you still want it. But, seriously, how important is it? It's trying to validate code that is half-written. How valuable can that be?
First of all, as-you're-typing code validation is distracting. It makes it harder to focus on the problem you are trying to solve. For example, writing a function with a non-void return will display the "not all code paths return a value" error continually until you get to the end of the function. In the meantime, the editor is telling you that there is a problem. I am sure that people learn to ignore these things over time (I have never kept the feature on for more than a few minutes after a new VS installation, so I don't know), but if you are actively ignoring something, then what good is it?
Second of all, any good that the validation would be capable of is unnecessary, because those errors will be brought to your attention at compile-time anyway. Having an uninitialized variable pointed out to you while you are thinking through the algorithm does not improve the quality of the code at all verses having it pointed out when you try to run the program. The variable is still going to be initialized either way. And there is an extremely high likelyhood that you are going to fix the problem before trying to run the code anyway.
So I just don't see the point of it. I suggest turning it off, and then your problem goes away.
UPDATE
As pointed out by #Charlie Kilian, there is a flaw in VS in which .aspx files are not validated at all, unless the "Show live semantic errors" option is enabled for C#, rather than validating those pages at compile-time as would be expected.
Therefore, editing aspx files will require turning this option back on for validation.
I guess I'll be going back-and-forth with it from now on. I hope they fix this in future versions of VS.
I still think that doing a semantic analysis and error-reporting on code that is actively being edited is a fool's errand. (Of course, I have also been known to write entire programs in notepad, just to see if I could get it to compile and run correctly the very first time without the crutch of Intellisense. It feels pretty awesome when it works.)
Selected answer is incorrect because unchecking "Always show Error List if build finishes with errors" does nothing to stop the dreaded Error List window from popping up on other errors, even if you change it to show only Build errors.
11 years later in Visual Studio 2022 it is still impossible to disable Error List window.
The only correct answer to the question "Completely remove error list from visual studio" is to uninstall Visual Studio itself which, thankfully, also removes Error List window.
Either that, or we should all get used to it, because Developer Gods from Microsoft want everyone to work in absolutely the same way as they do. Every workflow that differs from their own is wrong, and every thought that doesn't align with their grand vision is blasphemy.
It is One Microsoft Way or the highway.

Janus GridEx for ASP.NET Designer Support

I've been working with Janus GridEx for Web for a few days. I'm afraid I'm unable to open the GridEx designer (Grid context menu in ASP.NET designer), which makes real work fairly impossible or at least unproductive. I get the following error message:
Error invoking 'GridEX Designer'. Details:Exception has been thrown by the target of an invocation.
Unfortunately this error message doesn't really tell me anything about the real error. In Janus Forums, somebody had the same issue. The support guy recommended to check version and Local Copy property, but this isn't the cause of the problem (neither mine nor the guy's in Janus Forum).
Thank you for any help.
Greets
Matthias
Original text of this post:
I just figured out how to open the
GridEx designer. Visual Studio needs
to be running as Administrator ("Run
as Administrator" in Vista, and
confirm the UAC message). Don't like
that personally, but it works fine.
This is right so far, the message does not appear anymore. The designer did open, but did not save any changes. In Janussys forum, support staff had not seen this behavior before.
Currently the problem is different (I'd say even worse): The designer does not open, but the message mentioned in the opening post doesn't appear anymore. Just nothing happens. UAC is still disabled, and Visual Studio running as Administrator. I completely reinstalled the component with UAC disabled.
I know that "Doesn't work!" is no proper error description at all, but in this case I just don't know better.

Categories