IRONSOFTWAREHOME

Missing DLLs in Creating MSI Installer

Curtis Chau
Curtis Chau
Updated: September 24, 2025

When creating an MSI installer, you may encounter the following exception:

2025-01-27 16:57:23 - Error: IronBarCodeDetection.Exceptions.IronBarcodeDetectionException: Unexpected error occurred during execution of the IronBarcode Machine Learning library. Please provide details to support@ironsoftware.com for a resolution. ---> System.TypeInitializationException: The type initializer for 'Microsoft.ML.OnnxRuntime.NativeMethods' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.ML.OnnxRuntime.NativeMethods..cctor()
   --- End of inner exception stack trace ---
   at Microsoft.ML.OnnxRuntime.SessionOptions..ctor()
   at Iron.BarCode.Extensions.xjtagg`1..ctor(Stream dfepdx, SessionOptions dfepdy)
   at IronBarCodeDetection.BarcodeDetect.PredictObject[TModel](Stream modelStream)
   --- End of inner exception stack trace ---
   at IronBarCodeDetection.BarcodeDetect.PredictObject[TModel](Stream modelStream)
   at IronBarCodeDetection.BarcodeDetect.DetectBarCode()
   at Iron.BarCode.Extensions.cuewjf.ehxbbs(BarcodeDetect tlxjvd)
   at Iron.BarCode.Extensions.cuewjf.ehxbbr(AnyBitmap tlxjvd, Double tlxjve)
   at Iron.BarCode.Extensions.cuewjo.mvanli(AnyBitmap tlxjvd, Double tlxjve)
   at Iron.BarCode.Extensions.cuewjo.mvanlf(Image`1 tlxjvd)
   at Iron.BarCode.Extensions.cuewjo.mvankh(Object tlxjvd)
   at IronBarCode.BarcodeReader.Read(AnyBitmap inputImage, BarcodeReaderOptions barcodeReaderOptions)
   at WindowsFormsBarcode.Form1.btnBrowse_Click_1(Object sender, EventArgs e)
2025-01-27 16:57:23 - Error Message: Unexpected error occurred during execution of the IronBarcode Machine Learning library. Please provide details to support@ironsoftware.com for a resolution.
2025-01-27 16:57:23 - Inner Exception: The type initializer for 'Microsoft.ML.OnnxRuntime.NativeMethods' threw an exception.
2025-01-27 16:57:23 - Inner Exception Stack Trace:    at Microsoft.ML.OnnxRuntime.SessionOptions..ctor()
   at Iron.BarCode.Extensions.xjtagg`1..ctor(Stream dfepdx, SessionOptions dfepdy)
   at IronBarCodeDetection.BarcodeDetect.PredictObject[TModel](Stream modelStream)
Text

Reason

This error occurs because the library cannot find the required files to function properly.

Solution

To ensure the MSI installer runs smoothly, you must include the following three files in your setup project: onnxruntime.dll, IronBarcodeInterop.dll, and ReaderInterop.dll. These files are generated when you build the project in Release mode:

  • onnxruntime.dll: Located at MsiInstallerSample\MsiInstallerSample\bin\Release
  • IronBarcodeInterop.dll: Located at MsiInstallerSample\MsiInstallerSample\bin\Release\runtimes\win-x86\native
  • ReaderInterop.dll: Located at MsiInstallerSample\MsiInstallerSample\bin\Release\runtimes\win-x86\native

Make sure all three files are added to your Setup Project to avoid this exception.

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 2,422,100Version: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 BarCode
nuget.org/packages/BarCode/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronBarCode"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.9

  1. Download and unzip IronBarCode to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronBarCode.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
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
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