Fix: Leadtools.Forms.Ocr.OcrException. Image file create error.

If the Leadtools OCR engine is not started with the correct parameters, the exception "Image file create error" will be thrown. To fix this problem, make sure you start the OCR engine by executing the function Startup with parameter startupParameters set to the installation folder of Leadtools, like:

 

IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Plus, useThunkServer: false);
ocrEngine.Startup(null, null, "C:\Program Files (x86)\LeadTools\OCR Engine");

Fix: Exception "Mixed mode assembly is built against version ‘v2.0.50727’ of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.", when code is executed in a Microsoft Visual Studio 2012 test project.

When using an old version of LeadTools I encountered an exception during the execution of a Microsoft Visual Studio 2012 test. Mixed mode assembly is built against version ‘v2.0.50727’ of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. This error was fixed following the steps on http://blog.kristandyson.com/2012/05/encountering-systemiofileloadexception.html.

 

  1. Close Microsoft Visual Studio 2012 (and IIS express)
  2. On Windows 8, start Notepad.exe as an administrator
  3. Open the file [C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.executionengine.x86.exe.config]
  4. Add and save:

 

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <runtime>
    <legacyUnhandledExceptionPolicy enabled="1"/>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="Extensions" />     
    </assemblyBinding>
  </runtime>
  <system.diagnostics>
    <switches>
      <add name="TpTraceLevel" value="0" />
    </switches>
  </system.diagnostics>
  <appSettings>
    <!–<add key="ExecutionThreadApartmentState" value ="MTA"/>–>
    <!–<add key="TraceLogMaxFileSizeInKb" value ="10240"/>–> 

    <!– MsTest Adapter Specific AppSettings –>
    <add key="TestProjectRetargetTo35Allowed" value="true" />
   </appSettings>
   <startup useLegacyV2RuntimeActivationPolicy="true">
      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
   </startup>

</configuration>

How to copy data from Microsoft SQL Server 2012 localdb to Windows Azure.

I used the Export data wizard found in Microsoft SQL Server Management Studio, to copy data from a Microsoft SQL Server 2012 localdb database to Windows Azure.

  • Connect Microsoft SQL Server Management Studio to your localdb databse.
  • Right click database > Tasks > Export Data…
  • In the source dialog, choose
    • [.Net Framework Data Provider for SqlServer]
    • [Integrated Security = True]
    • [Data Source = (localdb)\V11.0]
    • [Initial Catalog = Your_Database]
    • [User Instance = True]
  • In the destination dialog, choose:
    • [.Net Framework Data Provider for SqlServer]
    • [Integrated Security = False]
    • [Data Source = yourdatabaseserver.database.windows.net]
    • [Initial Catalog = Your_Database]
    • [Password = YourPassword]
    • [User ID = YourUserId]
    • [User Instance = False]

 

 

Screendumps

 

image

image

image

 

image

image

image

 

NOTE

For an initial start of a project on Windows Azure I used the [Deploy Database to SQL Azure…] wizard:

 

image

How to enable JSON dynamic HttpCompression (gzip) on IIS in Windows 8.

First check if Dynamic compression is enabled:

 

image

 

administration.config

Open C:\Windows\System32\inetsrv\config\administration.config with notepad and change the httpCompression tag:

 

image

 

For IIS 7, also change the urlCompression tag:

image

 

ISA Server

If the dynamic compression is still not working, verify there is no ISA server between the server and the client, if so follow the steps on http://forums.iis.net/t/1168067.aspx

To check if the ISA server is the problem just open a browser on the server en connect to the localhost url, check with fiddler if the dynamic compression works.

Creating a Mac OS X development image

1. Download and install the latest version of VMWare Workstation 9 for Windows.

2. Unlock VMWare Workstation so it is able to run a MAC OS X image, follow the steps on http://www.souldevteam.net

2. Download the latest version of Mac OS X from the Apple store.

3. Convert the InstallESD.dmg found on the Mac OS X DVD "SharedSupport\InstallESD.dmg" to an *.iso  by using Magic ISO (http://www.magiciso.com/FAQ/FAQ0011.htm)

4. Create VMWare virtual machine based on the created ISO.

Before boot make sure you’ve checked the "Virtualize Intel VT-x/EPT or AMD-V/RVI" option under Hardware > Processors

5. Download and install the VMWare Tools for Mac OS X from http://www.souldevteam.net in the virtual machine.

6. Enable file sharing with the host.

7. Download an install XCode from the Apple store inside the virtual machine.

 

Creating the virtual machine

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

 

Installing Mac OS X in the VMWare Virtual Machine

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

 

Reboot the machine and install vmware tools (darwin.iso), this will install the correct video driver and will allow you to automatically fit the guest to the correct resolution, depending on the size of the VMWare workstation window.

See image below:

image

 

 

 

Enable file shareing (System Preferences > Sharing)

image

image

 

And this is a dev image so:

image

 

Now you can access files from you MAC OS X virtual machine on the windows host:

image

 

Transferring 1,5 gb xcode from host to client (usb 3.0)

image

Installing XCode

image

image

image

image

image

 

Enable developer modus

image

 

Change to keyboard layout

image

Change caps lock to apple key

image

 

 

PhoneGap

If you want to use PhoneGap, follow the steps on http://docs.phonegap.com/en/2.2.0/guide_getting-started_ios_index.md.html#Getting%20Started%20with%20iOS:

 

First install XCode commandline tools:

image

image

 

~/Documents/Programs:

image

 

Creating PhoneGap project for XCode:

image

 

Enable remote debugging

Add [NSClassFromString(@"WebView") performSelector:@selector(_enableRemoteInspector)]; to the function didFinishLaunchingWithOptions.

image

Run the app in the simulator.

Open Safari on the Mac > Develop > iPad Simulator > Index.html

image

Now you can remotely inspect your HTML, CSS and Javascript on an iOS 6 simulator.

image

 

Last but not least, make a backup of this dev image and store it on a separate external drive.