MSI 설치 관리자에서 누락된 DLL

Curtis Chau
Curtis Chau
업데이트됨: 2025년 9월 24일

MSI 설치 관리자를 만들 때 다음과 같은 예외가 발생할 수 있습니다:

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

이유

이 오류는 라이브러리가 올바르게 작동하는데 필요한 파일을 찾을 수 없기 때문에 발생합니다.

해결책

MSI 설치 프로그램이 원활하게 실행되도록 하려면 다음 세 가지 파일을 설치 프로젝트에 포함해야 합니다: onnxruntime.dll, IronBarcodeInterop.dll 및 ReaderInterop.dll. 이 파일들은 Release 모드로 프로젝트를 빌드할 때 생성됩니다:

  • onnxruntime.dll: 위치는 MsiInstallerSample\MsiInstallerSample\bin\Release입니다
  • IronBarcodeInterop.dll: 위치는 MsiInstallerSample\MsiInstallerSample\bin\Release\runtimes\win-x86\native입니다
  • ReaderInterop.dll: 위치는 MsiInstallerSample\MsiInstallerSample\bin\Release\runtimes\win-x86\native입니다

이 예외를 피하기 위해 모든 세 파일을 설정 프로젝트에 추가하십시오.

커티스 차우는 칼턴 대학교에서 컴퓨터 과학 학사 학위를 취득했으며, Node.js, TypeScript, JavaScript, React를 전문으로 하는 프론트엔드 개발자입니다. 직관적이고 미적으로 뛰어난 사용자 인터페이스를 만드는 데 열정을 가진 그는 최신 프레임워크를 활용하고, 잘 구성되고 시각적으로 매력적인 매뉴얼을 제작하는 것을 즐깁니다.

더 읽기

시작할 준비 되셨나요?

NuGet 다운로드 수 2,575,633버전:2026.11방금 출시