Hi Marcelo,
First of all, please accept our apologies for the delayed response.
As per your presented scenario, it seems that the resources are not getting released properly in your application. In order to further investigate the problem cause, and to suggest a solution, we will need to review your application on our end. Therefore we would request you to please provide us the standalone run-able sample application to replicate the said exception.
Moreover, the OcrEngine class does not implement System.IDisposable therefore you will not be able to initialize its object in a “using” construct. Although, it is suggested to load the Aspose.OCR resource file in a “using” construct to make sure the FileStream object is disposed properly when not needed. Please check the below provided code snippet for your reference.
C#
// Resource file: every version of the API uses specific resource file
const string resourceFileName = “Aspose.OCR.1.8.0.Resources.zip”;
// Source file: the file on which OCR will be performed
string imageFile = “sampleocr.bmp”;
Console.WriteLine("Performing OCR on " + imageFile + “…”);
// Initialize OcrEngine
OcrEngine ocr = new OcrEngine();
// Set the image
ocr.Image = ImageStream.FromFile(imageFile);
// Add language
ocr.Languages.AddLanguage(Language.Load(“english”));
// Load the resource file
using (ocr.Resource = new FileStream(resourceFileName, FileMode.Open))
{
try
{
// Process the whole image
if (ocr.Process())
{
// Get the complete recognized text found from the image
Console.WriteLine(“Text recognized.\n” + ocr.Text);
}
}
catch (Exception ex)
{
Console.WriteLine("Exception: " + ex.Message);
}
}
Hope this helps a bit.