unhandled-exception

null reference exception was unhandled C#

private void StartReadInlay2() { byte[] cSN = new byte[8]; byte[] sw12 = new byte[2]; string strsw12 = "", errdes = "", result = ""; test1_2 = new Initialisation(); test1_2.logmode = Convert.ToInt32(ConfigurationSettings.AppSettings["LogMode"]); test1_2.iChipType = GetChipT...

c++ stack trace from unhandled exception?

This question has been asked before and there have been windows-specific answers but no satisfactory gcc answer. I can use set_terminate() to set a function that will be called (in place of terminate()) when an unhandled exception is thrown. I know how to use the backtrace library to generate a stack trace from a given point in the progr...

Application.ThreadException for ALL exception? Not just un-trapped ones?

I'm trying to create a top level exception capture for a debug version of some real-time data capture software and was wondering if there was a top-level exception handler similar to Application.ThreadException that captures ALL exceptions, not just unhandled/trapped ones. Thanks in advance ...

How can I call my C# code from a C++ dll? Access violation problem.

Background: Big C++ MFC app that's not going to get rewritten any time soon. Few years ago needed to add features and decided that it would be easier built with C# and .NET so needed a way to call into .NET functions with the C++ app. At the time we were using VC6.0 for the MFC app and we built the .NET functionality using VS.NET 2...

When are DispatcherUnhandledException and AppDomain.UnhandledException insufficient (WPF app)?

I've hooked both of these, but occasionally my app still crashes and just throws up the Windows "an exception has occurred" dialog. When I click OK, the app just exits. Under what circumstances won't exceptions get caught with these two handlers (in a WPF app)? I should mention that I'm doing a bunch of COM interop, so that's always s...

unhandlex exceptions when using new after implementing a setup project in visual studio 2010

Hey I have my little client application which - when started - creates some user defined objects on the heap via "new" pHistory = new CHistory; This was no problem and everything ran fine until yesterday. I wanted to deploy my application and did decide to use a "Setup Project" from Visual Studio 2010. http://msdn.microsoft.com/en-u...

getting index out of range exception could where the problem in the code is

dbReader = DAL.GetCaseSumCasesAssnCtrlMgmtCtrlChargeCodesLeftJoin(ClientKey, txtCaseNumber.Text) If dbReader.Read Then Try txtmgm.Text = dbReader.Item("MgmtCtrlpKey") HoldMGMKey = dbReader.Item("AssnCtrlpKey") Catch ex As Exception End Try the exception is thrown at "AssnCtrlpkey" ...

Application global Error Logger

Hi all, While working on a vb.net application, in which exceptions were handled poorly. It was a big pain. So an Idea flashed , that if it is possible to genearte a library or service or some sort of exe that will log all error of an application without writing a single line of code / minimal code at some global location in host applic...

Exceptions not caught in release build (WinForm desktop app, C#, VS 2010)

I developed a desktop application, it's almost done but still contains some bugs which I'm eliminating. I use a general [try...catch] block wrapped around my application [STAThread] static void Main() { try { program = new Program(); // ... } catch (Exception x) { // ... MessageBox.Show( ...

IDE stopping at thrown AssertionException, rather than failing the test. (MSTestExtensions culprit?)

I am using NUnit asserts within a MSTest project like as follows (NOTE: This shouldn't matter see comments to Dave Falkner's answer): using Microsoft.VisualStudio.TestTools.UnitTesting; using MSTestExtensions; using Assert = NUnit.Framework.Assert; using Is = NUnit.Framework.Is; This has worked great in my unit tests, but in my integr...

Only last line of the Exception stack trace shows up

Hi all, I am having some trouble collecting information on an unhandled exception being generated (very rarely) in my code. I have set up an the handler pretty much the standard way. In the main I have: AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(ExceptionProcessor); And the handler function is: ...