This is a migrated thread and some comments may be shown as answers.

System.ExecutionEngineException when instrumenting code

1 Answer 179 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Devin
Top achievements
Rank 1
Devin asked on 06 Nov 2012, 04:44 PM
During our app initialization, we invoke RadRichTextBox.SatisfyImports().  This works fine during normal runtime, but when I instrument the code via running a memory profiler (SciTech's .Net Memory Profiler), this throws a System.ExecutionEngineException.  It doesn't contain an inner exception nor any call stack data.  

Not really understanding what is happening with SatisfyImports, nor what a System.ExecutionEngineException really means, I'm kind of at a loss.  It doesn't seem like there is anything I can do with my code to prevent this and I don't want to just suppress the exception when i profile because I need the app to behave as close to normal as possible.  Any suggestions? 

1 Answer, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 07 Nov 2012, 11:08 AM
Hello Devin,
RadRichTextBox uses MEF to load most of the UI (plus some other, like spell checking dictionaries) components, providing extensibility point for replacing them.  On RadRichTextBox.SatisfyImports call, MEF composition is triggered and tries to find suitable components to fill RadRichTextBox properties, for example RadRichTextBox.FindReplaceDialog. I am not sure what SciTech's .Net Memory Profiler, but maybe it somewhat changes the default MEF catalog. What you can do to check if this is the problem is to set the catalog to a list of predefined types, as described in this article.
You can also try to play with profiler's options, as it seems that garbage collection throws such exceptions when the system is under heavy load.


Kind regards,
Boby
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
RichTextBox
Asked by
Devin
Top achievements
Rank 1
Answers by
Boby
Telerik team
Share this question
or