ASP.NET中的Hunspell错误:该程序集不允许部分受信任的调用方. [英] Hunspell in ASP.NET Error: That assembly does not allow partially trusted callers.
本文介绍了ASP.NET中的Hunspell错误:该程序集不允许部分受信任的调用方.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人遇到以上错误吗?在VS2010本地主机上运行时,我的代码工作正常.当我将其发布到Godaddy共享托管时,我遇到了错误:
Has anyone ran into the above error? My code works fine when ran on my VS2010 localhost. When I publish it to Godaddy shared hosting I run into the error:
[SecurityException: That assembly does not allow partially trusted callers.]
Global.Application_Start(Object sender, EventArgs e) +0
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
try
{
string dictionaryPath = Server.MapPath("Bin") + "\\";
Hunspell.NativeDllPath = dictionaryPath;
spellEngine = new SpellEngine();
LanguageConfig enConfig = new LanguageConfig();
enConfig.LanguageCode = "en";
enConfig.HunspellAffFile = dictionaryPath + "en_us.aff";
enConfig.HunspellDictFile = dictionaryPath + "en_us.dic";
enConfig.HunspellKey = "";
spellEngine.AddLanguage(enConfig);
}
catch (Exception ex)
{
if (spellEngine != null)
spellEngine.Dispose();
}
}
我的Hunspell dll位于Bin目录中.上面的代码在App_Code \ Global.asax.cs目录中.
据我了解,NHunspell可用于共享主机环境.
任何方向或帮助将不胜感激.
谢谢.
My Hunspell dlls are in the Bin directory. The above code is in the App_Code\Global.asax.cs directory.
From my understanding, NHunspell can be used in shared hosting environments.
Any direction or help would be appreciated.
Thanks.
推荐答案
也许这会有所帮助,http://blogs.msdn.com/b/shawnfa/archive/2005/02/04/367390.aspx [
Perhaps this will help, http://blogs.msdn.com/b/shawnfa/archive/2005/02/04/367390.aspx[^]
这篇关于ASP.NET中的Hunspell错误:该程序集不允许部分受信任的调用方.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文