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

DocumentSpellChecker loading several binaries

3 Answers 77 Views
RichTextBox (obsolete as of Q3 2014 SP1)
This is a migrated thread and some comments may be shown as answers.
Aaron
Top achievements
Rank 1
Aaron asked on 19 Dec 2012, 06:40 PM
When we new up a DocuemntSpellChecker it loads several of our binaries into memory and we don't know why?

We create one like this:

DocumentSpellChecker sp = new DocumentSpellChecker();

As soon as we hit that code all of the binaries that are using a control with a DocumentSpellChecker are loaded into memory. This causes problems because we do a check on those binaries later in the app when we attempt to load a form from them. We check if the binary is up to date and if not replace it. We can't do that, however, because the documentSpellChecker has already loaded them into memory.

Any ideas?

3 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 21 Dec 2012, 12:03 PM
Hi Aaron,

Thank you for writing.

The DocuemntSpellChecker is implemented with MEF to support dynamic loading of different languages and plugins based model. To support this processing the MEF engine loads the assemblies in the application directory and searches for SpellChecker related interfaces implementation to create / load and activete the spell checker system.

I hope this information is helpful. Feel free to ask if you have any additional questions.

Kind regards,
Julian Benkov
the Telerik team
Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
0
Aaron
Top achievements
Rank 1
answered on 14 Jan 2013, 06:10 PM
I see. That is a problematic approach in a modular environment. We don't push all the binaries in our application down to the clients on each launch because it would severely slow the launch sequence. We update binaries for different modules on demand. Using the MEF approach in the DocumnentSpellChecker ties our hands. 

Is there any known way to prevent all the binaries from loading when a spell checker control is instantiated? I'm guessing no, but never hurts to ask.
0
Julian Benkov
Telerik team
answered on 16 Jan 2013, 01:23 PM
Hi Aaron,

The DocumenSpellChecker type uses the 
ImportMany attribute of MEF to populate the DictionaryList and this loads all assemblies in the application to search for 'IWordDictionary' interface implementation. This is by design behavior and in this situation the only suitable workaround for your application is to delay the creation of the DocumentSpellChecker instance in your application.

Do not hesitate to contact us if you have further questions or issues.

All the best,
Julian Benkov
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Tags
RichTextBox (obsolete as of Q3 2014 SP1)
Asked by
Aaron
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Aaron
Top achievements
Rank 1
Share this question
or