4

Using Visual Studio 2012 Express, how can I check the InnerException when a System.TypeInitializationException is raised from an external code frame. The debugger breaks due to the exception, however not at any code line. It gives the following message:

No Source Available
The call stack contains only external code.
Thi thread is stopped with only external code frames on the call stack. External code frames are typically from framework code but can also include other optimized modules which are loaded in the target process.

And then gives the call stack, See below:

enter image description here

I would set a try-catch block, but I don't know where in the code this happens. How can I inspect the InnerException at this point? Is there another way to go about finding what's up?

Jonathan Livni
  • 101,334
  • 104
  • 266
  • 359

1 Answers1

1

Repro code for such an exception where the stack trace looks exactly like yours:

class Program {
    static Program() {
        throw new Exception("kaboom");
    }
    static void Main(string[] args) {
    }
}

You should use the Exception Assistant that pops up when the exception is thrown. Click on "View Detail":

enter image description here

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536