IRONSOFTWAREHOME

Debugging Azure Functions on Local Machine with IronOCR

Curtis Chau
Curtis Chau
Updated: April 22, 2026

Issues when running Azure locally

Common exceptions seen when encountering this issue are:

  • Error while deploying Tesseract for IronOCR
  • Failed to locate 'libtesseract-5'
  • Unable to locate 'libtesseract-5'
  • Failed to locate Tesseract-5
  • Error while locating deployment configuration file at \bin\runtimes\win-x64\native\IronOcr.Native.deployment.json
  • IronOCR: Missing .traineddata file for 'EnglishBest' which should be located at

Issue with Dependencies when Running Azure Functions locally

When running Azure locally, using Azurite (VS2022) or the Azure Storage Emulator (VS2019), an additional bin directory is created that the Storage Emulator uses for deployment. Only DLL files are copied to this directory, so software that requires additional files will not function and may throw the above exception.

You may resolve this issue by copying the runtimes directory into the separate bin directory used by the Storage Emulator. We recommend doing this as a post-build event (see below for instructions) when running locally (as recompile/build will return the bin directory to its original state). You will not encounter this issue when deploying to the cloud.

  • Problem: When running an Azure Function project locally, it creates an additional bin folder which it runs the function out of. However, it does not copy all of the necessary files into said bin folder.
  • Example: A project at C:\code\azure-functions-test that builds to C:\code\azure-functions-test\bin\Debug\netcoreapp3.1
  • Solution: Copy the C:\code\azure-functions-test\bin\Debug\netcoreapp3.1\runtimes directory so it also exists within C:\code\azure-functions-test\bin\Debug\netcoreapp3.1\bin
  • Overwrite any existing files if prompted

Post-Build Event Steps

  1. Right-click on the Azure Functions project, select Properties.

  2. Scroll down to the Events section.

  3. Enter a Post-build event command that will copy all required files to the correct directory:

    XCOPY "$(TargetDir)runtimes" "$(TargetDir)bin\runtimes" /S /E /Y /I /R /D
    SHELL
    • Explanation:
      • XCOPY is used to copy files and directory trees.
      • $(TargetDir)runtimes is the source directory where runtime files are initially compiled.
      • $(TargetDir)bin\runtimes is the destination directory for runtime files when the application runs locally.
      • Options:
        • /S copies directories and subdirectories except empty ones.
        • /E copies all subdirectories, including empty ones.
        • /Y suppresses confirmation to overwrite existing files.
        • /I if the destination does not exist and copying more than one file, assumes that destination must be a directory.
        • /R overwrites read-only files.
        • /D copies only files that are newer or are missing from the destination.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Ready to Get Started?

Nuget Downloads 6,236,385Version:2026.9just released

Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.9

PM > Install-Package IronOcr
nuget.org/packages/IronOcr/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronOCR"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.9

or download Windows Installer here.

  1. Download and unzip IronOCR to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronOCR.dll"

Licenses from $999

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required