Click here to Skip to main content
15,910,773 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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


C#
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();
    }
}


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.
Posted

1 solution

 
Share this answer
 
Comments
willworknow1 24-Sep-10 8:35am    
This suggests that I need to recompile the dll's is that correct? Is there no other way to use Hunspell on a shared hosting server with medium and not full trust?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900