Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/331.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# WCF Teseract错误:试图读取或写入受保护内存。。。在exe上运行良好_C#_Wcf_Exception - Fatal编程技术网

C# WCF Teseract错误:试图读取或写入受保护内存。。。在exe上运行良好

C# WCF Teseract错误:试图读取或写入受保护内存。。。在exe上运行良好,c#,wcf,exception,C#,Wcf,Exception,我使用teseract v2对OCR图像进行处理,在exe中工作正常,但每次尝试在WCF上执行时,都会出现以下异常: var processor = new TesseractProcessor(); processor.SetVariable("tessedit_char_whitelist", Metadata.TextRegexPattern); processor.Init(@"../../tessdata/" + Language + ".traineddata", Language

我使用teseract v2对OCR图像进行处理,在exe中工作正常,但每次尝试在WCF上执行时,都会出现以下异常:

var processor = new TesseractProcessor();

processor.SetVariable("tessedit_char_whitelist", Metadata.TextRegexPattern);
processor.Init(@"../../tessdata/" + Language + ".traineddata", Language, 3);
processor.SetPageSegMode(_pageSegmentationMode);
processor.AnalyseLayout(source);

return processor.Recognize(Image.FromFile(filePath)); // here's problem with recognize method
尝试读取或写入受保护内存。这通常表示其他内存已损坏。

exe(工作)和wcf(例外)上的代码相同:


你的文件路径是什么?根据使用它的组件(无论是exe还是web服务),它是否有所不同?