unhandled-exception

Console Application - Can't Catch Unhandled Exception

I have written a very simple C# Console Application which will open a Crystal Report, refresh it and save it as a PDF to a specified location. When running within VS2005 everything runs fine; the pdf file is generated as expected. When I copy the .exe to my root C: drive and run it from the command line I get a dialog box stating that "...

When can an exception in a .NET WinForms app just get eaten without being caught or bubbling up to a windows exception?

In several places in our code, we notice that if running under debugger it'll show that there's an unhandled exception in the code, however if running outside the debugger it will just ignore the exception completely as if it were caught. We have an exception handler that pops up an error submit dialog that's hooked up to Application.Th...

Visual Studio Debuging Errors in C++

For some reason the integrated debugger is causing an error as soon as I make reference to a third party vendor's dll class. This same code runs when it is built and ran as a release, stand alone. The two properties for debug and release should be the same as I have not really altered them. I added the lib file to the path for both build...

In case of unhandled code exceptions, what is the most appropriate thing to show the end user?

In a web application, when your server side code screws up and experiences an unhandled exception, what is the most appropriate way to tell the end users of what happened? Do you simply say "Something unexpected happened and we are sorry". Should you try to make some sense of what the exception was and what the user was trying to do and ...

Problem with MessageBox.Show in catch

Hello, When I try to run the following code It causes an Unhandled Exception. After much tweeking with the code I found if commented out the MessageBox.Show line the problem goes away! Unusually I have used MessageBox.Show statments in other catch{ } segments in other parts of the code with no problems. My question is does anyone know wh...

Would you ever NOT catch an exception, or throw an exception that won't be caught?

I've dealt with instances where I would throw/rethrow an exception knowing that the code surrounding it would catch the specific exception. But is there any time you would want to throw an exception, knowing that it wouldn't be caught? Or at least, NOT catch an exception? Exceptions immediately halt the application unless their handle...

Exceptions on .Net ThreadPool Threads

Duplicate: How to catch exceptions from a ThreadPool.QueueUserWorkItem? I am queueing up multiple delegates on the .Net ThreadPool for a large number of independant remoting calls that themselves call multiple databases and other offline resources. By Queueing these calls on the ThreadPool I can run them concurrently and minimize th...

Unhandled exception at 0x10012c5d (highgui110.dll)

Hi there I had OpenCV lib installed on my machine and all was working fine, until I decided to try the new version of the lib 1.1pre. Since that moment I get the following error: Unhandled exception at 0x10012c5d (highgui110.dll) in foo.exe: 0xC0000005: Access violation reading location 0x719b3856. I've tryied to uninstall and reinst...

Why is UnhandledExceptionEventArgs.ExceptionObject an object and not an Exception?

Why is UnhandledExceptionEventArgs.ExceptionObject an object and not an Exception? I am attaching to AppDomain.UnhandledException. I would like to cast UnhandledExceptionEventArgs.ExceptionObject to an Exeption and interogate it. And with this in mind will it ever be null? The MSDN documentation is not exatly useful http://msdn.mic...

Unhandled exceptions in BackgroundWorker

I have a small WinForms app that utilizes a BackgroundWorker object to perform a long-running operation. The background operation throws occasional exceptions, typically when somebody has a file open that is being recreated. Regardless of whether the code is run from the IDE or not .NET pops up an error dialog informing the user that a...

AppDomain.CurrentDomain.UnhandledException not firing without debugging

Hi, I have a .NET program with an event handler bound to Application.CurrentDomain.UnhandledException. When running the program with debugging, this event fires when an unhandled exception is thrown. However, when running without debugging, the event does not fire. What is my problem? Thanks, Andrew ...

Catching Unhandled Exceptions in Child Threads in WPF

I have a WPF application that spins off several threads. I have defined a DispatcherUnhandledException event handler in App.xaml.cs that displays a detailed error message, and this handler gets called every time the UI thread encounters an exception. The problem is with the child threads: their unhandled exceptions never get handled. How...

Why does an unhandled exception not terminate a process while debugging?

This is a behavior I noticed several times before and I would like to know the reason behind that. If you run the following program under the (Visual Studio 2008) debugger, the debugger will keep breaking on the throw statement no matter how often you continue debugging. You have to stop debugging to get out there. I would expect that th...

WinForms - why aren't my exceptions caught?

Hi, In my multithread server I am using following code (before running Form itself or course) AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomainUnhandledException); Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(ApplicationThreadException); The called methods...

Using handled exceptions as an intended trigger?

Occasionally in my code I will intentionally use a thrown exception as an event trigger. For instance, I will loop UNTIL an exception is thrown and then break; in the catch clause. Is this bad practice? Would it be more efficient (or cleaner) to query some attribute of what I am looping to predetermine the indices (i.e. predetermine w...

How do I diagnose "Unhandled Exceptions" in Java?

In a Java program I am currently getting "Unhandled Exception" at a certain point in the program and I can't seem to determine the location where this is being generated. Its also difficult to debug the code as the program contains streams that handle wireless data bytes sent and received. I can't seem to simulate that with a debugger. ...

Exception handling with multiple forms

I'm seeing different behavior with exceptions being caught or not being caught when I am debugging vs. when I am running a compiled .exe. I have two forms (Form1 and Form2). Form1 has a button on it which instantiates and calls ShowDialog on Form2. Form2 has a button on it which intentionally produces a divide by zero error. When I'm...

Access Violation On Vista Startup

I occasionally get a strange unhandled access violation when my .NET application is started automatically on startup (using a shortcut in the "Startup" folder) by Windows Vista. I have not seen this error when I start the executable manually. It happens randomly and I have yet to be able to reproduce the issue reliably. Here's the mes...

CryptographicException: Padding is invalid and cannot be removed and Validation of viewstate MAC failed

Monitoring my global exception logs this error seems to be impossible to remove no matter what I do, I thought I finally got rid of it but it's back again. You can see a strack trace of the error on a similar post here. Notes about the environment: IIS 6.0, .NET 3.5 SP1 single server ASP.NET application Steps already taken: <syste...

PushViewController now crashes

In some working code, I had a call to PushViewController, which loaded (successfully) a new view from an xib. I went into the XIB and added a couple of buttons. Retried the code, and the view continued to be displayed at the appropriate point in the code. I then deleted those buttons, and since that point, the code no longer works. It ...