0

Webプロジェクトで動作するようにTessnet2ライブラリを実装しました。デバッグ中に、私はすべての「通常の」バグを取り除きました++。

このソリューションをVisualStudio2010を使用してWebサーバーに展開し、サイトをテストすると、次のエラーメッセージが表示されます。

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-folderをサーバー上のbinフォルダーに移動しようとしましたが、tessnet2_32.dllファイルとpdbファイルがサーバー上のbinフォルダーにあることを確認しました...

他のすべてのライブラリも存在する必要があります。

4

1 に答える 1

1

サーバーは 64 ビット プロセスで、tessnet2_32.dll は 32 ビットです。したがって、DLL をロードしてこの例外を取得することはできません。

于 2012-05-23T13:26:13.227 に答える