How to resolve Hunspell Intel 32bit DLL not found exception?

I used the following code to check spelling.

While I run it, I get a 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 made a link to Hunspell.dll in the project. What's wrong?

+6
c # hunspell
source share
4 answers

You need to enable your own Hunspellx86.dll next to the managed NHunspell.dll .

I made the following path:

  • NHunspell Link.
  • set the Copy Local property
  • Include NHunspellx86.dll in my project
  • Set the Copy to source directory property to copy if new.

This ensures that native Hunspell.dll is in place.

+5
source share

I reproduced this error in two different scenarios using NHunspell v 0.9.4. NHunspell seems to display this error message for a number of problems that may occur during the download process of the corresponding unmanaged Hunspellx ** file. Dll.

The first reason I discovered is that if 32-bit applications were not enabled in the specific IIS application pool that my webapp is running on. This, of course, is relevant only if you use the 32-bit webapp on a 64-bit machine.

The second reason I found that the user of the IIS process did not have the appropriate permissions to read the folder containing Hunspellx **. dll. IIS users (a group called MACHINENAME \ IIS_IUSRS) must have permission to read and execute each file in the webapp runtime directory (and the bin subfolder).

+3
source share

Ensure that with the Copy Always option for the local copy setting, right-click NHunspell.DLL in Solution Explorer.

+1
source share

I had this problem in a production environment where the version of the unmanaged DLL was a bit older than the version with which the ASP.Net project was created.

In particular, FusLogVw showed:

 LOG: Assembly download was successful. Attempting setup of file: C:\ThePath\Hunspellx64.dll LOG: Entering download cache setup phase. ERR: Error extracting manifest import from file (hr = 0x80131018). ERR: Setup failed with hr = 0x80131018. ERR: Failed to complete setup of assembly (hr = 0x80131018). Probing terminated. 

Updating the correct version of unmanaged DLLs resolved the issue.

0
source share

All Articles