SEHException when debugging

Not sure if anyone has this issue, but when I want to debug my code, at a certain line of code where I want to step into a function. I get this error. I do not know why it is looking for this Utilities.cs

Locating source for ‘d:\integration\rhino5\src4\rhino4\Plug-ins\Toolbars\Utilities.cs’. Checksum: MD5 {32 5e db f7 14 2c 47 62 51 41 b2 2f 29 ee c6 fd}
The file ‘d:\integration\rhino5\src4\rhino4\Plug-ins\Toolbars\Utilities.cs’ does not exist.
Looking in script documents for ‘d:\integration\rhino5\src4\rhino4\Plug-ins\Toolbars\Utilities.cs’…
Looking in the projects for ‘d:\integration\rhino5\src4\rhino4\Plug-ins\Toolbars\Utilities.cs’.
The file was not found in a project.
Looking in directory ‘C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\crt\src’…
Looking in directory ‘C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\crt\src\vccorlib’…
Looking in directory ‘C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\src\mfc’…
Looking in directory ‘C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\src\atl’…
Looking in directory ‘C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include’…
Looking in directory ‘c:’…
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: d:\integration\rhino5\src4\rhino4\Plug-ins\Toolbars\Utilities.cs.
The debugger could not locate the source file ‘d:\integration\rhino5\src4\rhino4\Plug-ins\Toolbars\Utilities.cs’.

After it cannot find the Utilities.cs, then the program will throw an Exception and Rhino will crash out. However, it doesn’t happen if the code runs itself. However, there is a bug in my program and I want to find out why the calculation is wrong.

System::AppDomain::CurrentDomain->UnhandledException event occured

SENDER: Name:DefaultDomain
There are no context policies.

EXCEPTION: System.Runtime.InteropServices.SEHException
MESSAGE: External component has thrown an exception.
SOURCE: Rhino_DotNet
CALL STACK
at CRhinoUiDockBar.PreTranslateMessage(CRhinoUiDockBar* , tagMSG* )

Hi Toby,

We’re going to need more details. Can you repeat this? Are you working in C# and RhinoCommon? Is your debug target the Release version of Rhino (found in Program Files)?

Help…

– Dale

Can you repeat this?
Yes, I can repeat it, however it is hard to paste the code here.

Are you working in C# and RhinoCommon?
Yes, I am working in C# with RhinoCommon.

Is your debug target the Release version of Rhino (found in Program Files)?
Yes, my debug target is:
C:\Program Files\Rhinoceros 5 (64-bit)\System\Rhino.exe

I reckon is something to do with calling functions inside functions that spans in multiple classes that cause the issue.

You might want to turn on CLR exceptions. In Visual Studio go to the Debug menu, select Exceptions… From there ensure Common Language Runtime Exceptions check box for the Thrown column is checked. This will possibly give you a better call stack.