How do I resolve a Hunspell Intel 32bit DLL not found exception?
asp.net, c#, hunspell
Solution
You need to include the native `Hunspellx86.dll` next to the the managed `NHunspell.dll`.
I did the following way:
- Referenced `NHunspell`.
- set the Copy Local property
- Include the `NHunspellx86.dll` to my project
- Set "Copy to output directory" property "copy if newer".
This ensures that the native Hunspell.dll will be in place.
Problem
I have used the following code for spelling checking. While I am running it, I get an `DLLFileNotFound` exception: "Hunspell Intel 32Bit DLL not found: C:\project\splee\Hunspellx86.dll". Code Snippet: ``` using (Hunspell hunspell = new Hunspell("en_us.aff", "en_us.dic")) { bool correct = hunspell.Spell("Recommendation"); var suggestions = hunspell.Suggest("Recommendation"); foreach (string suggestion in suggestions) { Console.WriteLine("Suggestion is: " + suggestion); } } // Hyphen using (Hyphen hyphen = new Hyphen("hyph_en_us.dic")) { var hyphenated = hyphen.Hyphenate("Recommendation"); } using (MyThes thes = new MyThes("th_en_us_new.idx", "th_en_us_new.dat")) { using (Hunspell hunspell = new Hunspell("en_us.aff", "en_us.dic")) { ThesResult tr = thes.Lookup("cars", hunspell); foreach (ThesMeaning meaning in tr.Meanings) { Console.WriteLine(" Meaning: " + meaning.Description); foreach (string synonym in meaning.Synonyms) { Console.WriteLine(" Synonym: " + synonym); } } } ``` I have made a reference to `Hunspell.dll` in the project. What's going wrong?