Ace Grace
Ace Grace

Reputation: 641

Error does not occur in VS2010 when debugging but does occur if I run the program outside VS2010 from the debug folder

I have a C# app which has an error which I cannot locate.

When I run the app from within the debugger, the error does not occur but if I run the app from outside VS2010 in the debug folder (still the debug version of the app) I get the error.

The error is an 'Object not set to an instance of an object'. The error itself is not the issue itself, but why it doesn't happen when debugging in VS2010 (.NET 4).

Upvotes: 0

Views: 445

Answers (1)

Hans Passant
Hans Passant

Reputation: 941545

If you already know where the error occurs then simply write a one-liner before it to start the debugger:

   System.Diagnostics.Debugger.Launch();

Upvotes: 2

Related Questions