Я реализовал библиотеку Tessnet2 для работы в моем веб-проекте. В процессе отладки я избавился от всех "обычных" ошибок ++.
Когда я развертываю это решение на веб-сервере с Visual Studio 2010 и тестирую сайт, я получаю сообщение об ошибке:
Could not load file or assembly 'tessnet2_32' or one of its dependencies.
An attempt was made to load a program with an incorrect format.
Трассировка стека выглядит следующим образом:
[BadImageFormatException: Could not load file or assembly 'tessnet2_32' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +567
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +192
System.Reflection.Assembly.Load(String assemblyString) +35
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +123
[ConfigurationErrorsException: Could not load file or assembly 'tessnet2_32' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +11568160
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +485
System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +79
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +337
System.Web.Compilation.BuildManager.CallPreStartInitMethods() +280
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1167
[HttpException (0x80004005): Could not load file or assembly 'tessnet2_32' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11700896
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +11532014
Вопрос в том, видел ли кто-нибудь это раньше? и справился? или знаете как исправить?
Я попытался переместить папку tessdata в папку bin на сервере, я убедился, что файл tessnet2_32.dll и файл pdb находятся на сервере в папке bin ...
Все остальные библиотеки также должны присутствовать.