简体   繁体   English

使用aff文件时System.EntryPointNotFoundException

[英]System.EntryPointNotFoundException when using aff file

I have created a project where I take a word in and use the Hunspell.dll class to do a check spell. 我创建了一个项目,我在其中使用了一个单词并使用Hunspell.dll类来进行检查。 Please note I downloaded this dll from a package through the xamarin studio IDE (FOR MAC). 请注意我通过xamarin studio IDE(FOR MAC)从包中下载了这个dll。 I also downloaded the .aff and .dic files needed for the class to check the word and added them to my debug folder but when I compile the application i get the following error: System.EntryPointNotFoundException. 我还下载了类所需的.aff和.dic文件来检查单词并将它们添加到我的调试文件夹中,但是当我编译应用程序时,我收到以下错误:System.EntryPointNotFoundException。 If you have any ideas please let me know. 如果您有任何想法,请告诉我。

This is my code: 这是我的代码:

using NHunspell;

public static void Main(string[] args)
{
    string line = Console.ReadLine();
    using (Hunspell hunspell = new Hunspell("en_us.aff", "en_us.dic"))
    {
        bool correct = hunspell.Spell(line);
        Console.WriteLine(line + " is spelled " + (correct ? "correct" : "not correct"));
    }    
}

Assuming you are using the NHunspell port of Hunspell. 假设您正在使用Hunspell的NHunspell港口。 Very likely your native Hunspell library is not the desired one (a CPU architecture mismatch kind of thing.) This issues are very hard to diagnose without knowing your exact environment and the libraries you are using. 很可能你的本地Hunspell库不是理想的库(CPU架构不匹配的东西。)如果不知道你的确切环境和你正在使用的库,这个问题很难诊断。

I have, however, tried your example by installing NHunspell with NuGet in Visual Studio and downloading the aff and dic files manually. 但是,我通过在Visual Studio中使用NuGet安装NHunspell并手动下载affdic文件来尝试您的示例。 It is working just fine. 它工作得很好。 I suggest you better try installing NHunspell from NuGet. 我建议你最好尝试从NuGet安装NHunspell。 Xamarin Studio also supports NuGet package management. Xamarin Studio还支持 NuGet包管理。 NuGet takes care of finding the proper native library for your environment, deploying them properly, etc. NuGet负责为您的环境找到合适的本机库,正确部署它们等。

Update : For Xamarin in platforms other than Windows. 更新对于Windows以外的平台中的Xamarin。

NHunspell is a .NET wrapper around the Hunspell library that is written in C/C++. NHunspell是一个围绕Hunspell库的.NET包装器,用C / C ++编写。 For NHunspell to work properly, there must be a build of the Hunspell library for that particular environment that NHunspell is able to invoke. 为了使NHunspell正常工作,必须为NHunspell能够调用的特定环境构建Hunspell库。 Xamarin has nothing to do with that. Xamarin与此无关。

According to the NHunspell author , up to February 2015 there is no such build for non-Windows platforms. 根据NHunspell的作者 ,截至2015年2月,没有针对非Windows平台的此类构建。 The last release of NHunspell appeared in March 2015. So it can be safely assumed that NHunspell is available only for Windows up to now. NHunspell的最后一个版本于2015年3月出现。因此可以安全地假设NHunspell仅适用于Windows到目前为止。 So even installing NHunspell with NuGet doesn't do any good. 所以即使用NuGet安装NHunspell也没有任何好处。

I myself tried using NHunspell from MonoDevelop in Ubuntu 16.04. 我自己尝试在Ubuntu 16.04中使用MonoDevelop的 NHunspell。 Installation was successful with NuGet, however, on run, I got exactly the same error: System.EntryPointNotFoundException . 使用NuGet成功安装,但是,在运行时,我得到了完全相同的错误: System.EntryPointNotFoundException As MonoDevelop and Xamarin Studio uses the same .NET runtime (called Mono ) so the same should be true for Xamarin. 由于MonoDevelop和Xamarin Studio使用相同的.NET运行时(称为Mono ),因此Xamarin也应如此。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从 DLL 调用 function 时出现 System.EntryPointNotFoundException - System.EntryPointNotFoundException when calling function from DLL System.EntryPointNotFoundException以平行红色显示在输出中 - System.EntryPointNotFoundException in Parallel red in output System.EntryPointNotFoundException:无法找到入口点 - System.EntryPointNotFoundException: Unable to find an entry point 未处理的异常:DLL中的System.EntryPointNotFoundException - Unhandled Exception: System.EntryPointNotFoundException in DLL Mono 2.8上的SWIG中的System.EntryPointNotFoundException错误 - System.EntryPointNotFoundException error in SWIG on mono 2.8 从C#调用C ++代码时出现System.EntryPointNotFoundException - System.EntryPointNotFoundException when calling C++ code from C# 尝试从C#调用非托管函数时出现'System.EntryPointNotFoundException' - 'System.EntryPointNotFoundException' when trying to call unmanaged function from C# System.EntryPointNotFoundException和DllImport(“ kernel32.dll”) - System.EntryPointNotFoundException and DllImport(“kernel32.dll”) 在Linux中,单声道调用我的.so lib返回System.EntryPointNotFoundException - in linux, mono invoke my .so lib return System.EntryPointNotFoundException Owin / Katana System.EntryPointNotFoundException程序集位于其他位置 - Owin/Katana System.EntryPointNotFoundException Assembly located elsewhere
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM