In order to compile successful with Visual Studio 2012 or Visual Studio 2013 please follow the steps below:
1. Install the windows phone OCR SDK in VS2012 or VS2012 express. If you have installed a new version or update please make sure that you have uninstalled the previous one. Check in your control panel "Control Panel\Programs\Programs and Features\Unistall or Change a program" and make sure that you have only one entry with the "DevScope OCR SDK".
2. Open Visual Studio 2012 and open the
"DevScope.Ocr.Tesseract.UsageWP8Sample.csproj" project. On a typicall installation the project should have been installed in the
"C:\Program Files (x86)\DevScope\OCR SDK Tesseract Engine\DevScope.Ocr.Tesseract.UsageWP8Sample" folder. But that depends on your system. Please note that the
"C:\Program Files (x86)\" is a secure system folder so probably Visual Studio is going to ask you to Restart using elevated permissions.
3. After opening the project in Visual Studio, please check and validate the references. You will find 2 references to
"DevScope.Ocr.Tesseract.WP8RT" and one of them probably has a yellow exclamation mark on it. This has to do with Visual Studio inability to automatically reference different components depending on the Platform. Also note that this is a WINRT native component and when referencing it, you must point/select Visual Studio to the
"DevScope.Ocr.Tesseract.WP8RT.winmd" file and not the
"DevScope.Ocr.Tesseract.WP8RT.dll" 4. Make sure that you sure that you are referencing the correct assembly for the current platform. If you are compiling your app for the Emulator you have to reference the
"DevScope.Ocr.Tesseract.WP8RT.winmd" in the
"C:\Program Files (x86)\DevScope\OCR SDK Tesseract Engine\Binaries\.Net4\Emulator_X86" folder. If you are compiling for the Device you have to reference the
"DevScope.Ocr.Tesseract.WP8RT.winmd" file in
"C:\Program Files (x86)\DevScope\OCR SDK Tesseract Engine\Binaries\.Net4\Device_ARM".
5. The text in the step before is why the yellow exclamation mark appears. The way to trick Visual Studio 2012 to do that switch automatically without continuously re-referencing the correct file is to edit the
"DevScope.Ocr.Tesseract.UsageWP8Sample.csproj" project file (in notepad for example) and insert/replace the reference statement to something like the text below (adapt the paths to where you have installed the SDK) :
<ItemGroup >
<Reference Include="DevScope.Ocr.Tesseract.WP8RT" Condition="'$(Platform)' == 'ARM'">
<HintPath>..\..\..\..\..\Program Files (x86)\DevScope\OCR SDK Tesseract Engine\Binaries\.Net4\Device_ARM\DevScope.Ocr.Tesseract.WP8RT.winmd</HintPath>
</Reference>
<Reference Include="DevScope.Ocr.Tesseract.WP8RT" Condition="'$(Platform)' == 'x86'">
<HintPath>..\..\..\..\..\Program Files (x86)\DevScope\OCR SDK Tesseract Engine\Binaries\.Net4\Emulator_X86\DevScope.Ocr.Tesseract.WP8RT.winmd</HintPath>
</Reference>
</ItemGroup>
So, make sure that you are referencing the correct component for the Platform that you are building :
ARM for Device and x86 for Emulator, and point to the
.winmd files and not the dlls.
6. Now, in Visual Studio open the file
MainPage.xaml.cs, and locate the method:
SetTesseractEngineLicense. In that method, type the license information that you have received by email :
var status = TesseractOcrEngine.SetLicense("License Name", "License Email","Unlock key");
Replace the
"License Name",
“License Email” and
“Unlock Key” with the activation codes that you have received by email.
7. After all this steps, its All done and you should be good to go.
Contact support if you need any additional info.