I have a C# WPF app that makes use of a number of assemblies that use native code. My problem is that most of the time, when my application throws an exception, the Exception Assistant does not come up - just the Break/Continue/... dialog. I of course have the Exception Assistant turned on in the Visual Studio options, and I have the par...
I have a C# WPF application that is suddenly throwing an exception on startup, and I cannot figure out why. The exception is a C++ HRException, and it occurs in MSCORLIB in CreateInstanceSlow(), which is called from CreateInstance(), which is called from BamlRecordReader.CreateInstanceFromType() in the System.Windows.Markup assembly. I m...
I'm trying to fix the test suite on an project which I've inherited from another programmer for some java database code. The project itself is using hibernate and MySQL for the DB stuff, but for the purposes of the test cases dbunit is being used. I can correctly load and initialize hibernate's session factory, but I keep getting excep...
What exactly is a first chance exception? How and where does it originate in a .Net program? And why is it called by that peculiar name (what 'chance' are we talking about)?
...
One of the things I loved about VB6 is that you had the ability to tell the development environment to break on all errors regardless of what error handling you had set up. Is it possible to do the same thing in VS2008 so that the debugger will stop on any error even if it happens inside a try-catch statement?
The problem is particular...
I am seeing following exception.
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Web.Util.StringUtil.memcpyimpl(Byte* src, Byte* dest, Int32 len)
at System.Web.Util.StringUtil.UnsafeStringCopy(String src, Int32 srcIndex, Char[] dest, Int32 destIndex, Int32 len)
at System.Web.HttpW...
Do you know how expensive exception throwing and handling in java is?
We had several discussions about the real cost of exceptions in our team. Some avoid them as often as possible, some say the loss of performance by using exceptions is overrated.
Today I found the following piece of code in our software:
private void doSomething()
{...
I'm getting this exception (Full exception at the bottom):
NHibernate.PropertyValueException was unhandled by user code
Message="not-null property references a null or transient
valueClearwave.Models.Encounters.Insurance.Patient"
Source="NHibernate"
EntityName="Clearwave.Models.Encounters.Insurance"
PropertyName="Patient"
I've don...
If I have code like this:
void a()
{
try
{
b();
}
catch (MyException)
{
// Handle any problems that occurred in b(c(d()))
}
}
void b()
{
c();
// Do something else
}
void c()
{
d();
// Do something else
}
void d()
{
// Do something, throw a MyException if it fails
}
Assumin...
I'm using JScript.NET to write scripts in a C# WinForms application I wrote. It works really well, but I just tried putting some exception handling in a script, and I can't figure out how to tell what type of exception was thrown from my C# code.
Here's some example JScript code that throws two different types of CLR exception, and then...
I am developing a console-based .NET application (using mono). I'm using asynchronous I/O (Begin/EndReceive).
I'm in the middle of a callback chain several layers deep, and if an exception is thrown, it is not being trapped anywhere (having it bubble out to the console is what I would expect, as there is currently no exception handling...
Lets say you had some resource clean up like: This is C#.
try{/*stuff*/}
catch(Exception e) {/*rollback logs etc.*/}
finally{
if( context.Transaction != null )
context.Transaction.Dispose();
context.Connection.Close();
context.Connection.Dispose();
}
Would it be more robust to do this instead?
try{/*stuff*/}
catch(Exception e) {...
I have a try...except block in my code and When an exception is throw. I really just want to continue with the code because in that case, everything is still able to run just fine. The problem is if you leave the except: block empty or with a #do nothing, it gives you a syntax error. I can't use continue because its not in a loop. Is the...
I would like to handle fpu exception on windows, something like:
#include <math.h>
#include <fenv.h>
#include <stdio.h>
int main()
{
double b = 0;
int raised;
feclearexcept (FE_ALL_EXCEPT);
b /= 0;
raised = fetestexcept (FE_OVERFLOW | FE_INVALID);
if (raised & FE_OVERFLOW) { printf("over\n");}
if (raised & F...
Recently I attended Jeffrey Richter's training courses about .NET. He mentions one strategy of coding "Dying is awesome". That is, don't write "catch (Exception ex)" even at the root of program or event loop. If some exception thrown that is not handled, just let the process die.
I'm not sure this is right. Personally, I prefer to have...
Response.Redirect has two overloads:
public void Redirect(string url)
Parameters:
url: The target location.
public void Redirect(string url, bool endResponse)
Parameters:
url: The location of the target.
endResponse: Indicates whether execution of the current page should terminate.
If I call the first overload, or call the second wit...
Hello,
I have a c++ class and I am trying to run it in ubuntu:
#ifndef WRONGPARAMETEREXCEPTION_H_
#define WRONGPARAMETEREXCEPTION_H_
#include <iostream>
#include <exception>
#include <string>
using namespace std;
#pragma once
class WrongParameterException: public exception
{
public:
WrongParameterException(char...
Hello!
I have a dialog that has to process large quantaties of data (the procedure is quite time consuming - first the ODBC fill takes its time, then the data processing kicks in) and the result is that the Form becomes unresponsive. This is not a problem really, it is enough to just open a "loading screen" in a new thread to notify the...
It seems to me that a lot of my debugging time is spent chasing down null-reference exceptions in complex statements. For instance:
For Each game As IHomeGame in _GamesToOpen.GetIterator()
Why, when I get a NullReferenceException, can I get the line number in the stack trace, but not the name of the object that equals null. In other w...
I am trying to create a program that has a button and a text box. Everytime the button is pushed I want it to add one to the text box. I keep getting this error:
Overload resolution failed because no
accessible 'Int' accepts this number
of arguments
Also I am a huge n00b. Here is where I am at so far, thanks in advance.
Optio...