ASP.NET中的Hunspell错误:该程序集不允许部分受信任的调用方.

编程入门 行业动态 更新时间:2024-10-25 18:31:27
本文介绍了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.

推荐答案

也许这会有所帮助,blogs.msdn/b/shawnfa/archive/2005/02/04/367390.aspx [ ^ ] Perhaps this will help, blogs.msdn/b/shawnfa/archive/2005/02/04/367390.aspx[^]

更多推荐

ASP.NET中的Hunspell错误:该程序集不允许部分受信任的调用方.

本文发布于:2023-11-05 08:39:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1560385.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不允许   错误   程序   ASP   NET

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!