System.Runtime.InteropServices.SEHExceptionon addLayout


I tried to run the example frmo the link:, but I end up with SEH exception. I have executed the method with this input:
var doc = RhinoDoc.ActiveDoc;

What am I doing wrong?


Maybe the reason is that I used it inside background worker, my mistake.

Using a background thread for this is definitely why the exception is occurring.