MSI Yükleyici Oluştururken Eksik DLL'ler
MSI yükleyicisi oluştururken şu istisnayla karşılaşabilirsiniz:
2025-01-27 16:57:23 - Hata: IronBarCodeDetection.Exceptions.IronBarcodeDetectionException: IronBarcode Makine Öğrenmesi kütüphanesinin çalıştırılması sırasında beklenmeyen bir hata oluştu. Lütfen çözüm için ayrıntıları support@ironsoftware.com adresine sağlayınız. ---> System.TypeInitializationException: 'Microsoft.ML.OnnxRuntime.NativeMethods' için tür başlatıcısı bir istisna fırlattı. ---> System.NullReferenceException: Nesne başvurusu bir nesne örneğine ayarlanmadı.
Microsoft.ML.OnnxRuntime.NativeMethods..cctor() öğesinde
--- iç istisna yığını izinin sonu ---
at Microsoft.ML.OnnxRuntime.SessionOptions..ctor()
at Iron.BarCode.Extensions.xjtagg`1..ctor(Stream dfepdx, SessionOptions dfepdy)
at IronBarCodeDetection.BarcodeDetect.PredictObject[TModel](Stream modelStream)
--- iç istisna yığını izinin sonu ---
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 - Hata Mesajı: IronBarcode Makine Öğrenimi kütüphanesi çalıştırılırken beklenmeyen hata oluştu. Lütfen çözüm için ayrıntıları support@ironsoftware.com adresine sağlayınız.
2025-01-27 16:57:23 - İç Hata: 'Microsoft.ML.OnnxRuntime.NativeMethods' için tür başlatıcısı bir istisna fırlattı.
2025-01-27 16:57:23 - İç Hata Yığın İzleme: at Microsoft.ML.OnnxRuntime.SessionOptions..ctor()
at Iron.BarCode.Extensions.xjtagg`1..ctor(Stream dfepdx, SessionOptions dfepdy)
at IronBarCodeDetection.BarcodeDetect.PredictObject[TModel](Stream modelStream)
Neden
Bu hata, kütüphanenin düzgün çalışabilmesi için gereken dosyaları bulamaması nedeniyle oluşur.
Çözüm
MSI yükleyici sorunsuz çalışmasını sağlamak için, kurulum projenize aşağıdaki üç dosyayı dahil etmelisiniz: onnxruntime.dll, IronBarcodeInterop.dll ve ReaderInterop.dll. Bu dosyalar, projeyi Derleme modunda derlediğinizde üretilir:
onnxruntime.dll: Bulunduğu yer MsiInstallerSample\MsiInstallerSample\bin\ReleaseIronBarcodeInterop.dll: Bulunduğu yer MsiInstallerSample\MsiInstallerSample\bin\Release\runtimes\win-x86\nativeReaderInterop.dll: Bulunduğu yer MsiInstallerSample\MsiInstallerSample\bin\Release\runtimes\win-x86\native
Bu istisnadan kaçınmak için üç dosyanın tümünü Kurulum Projenize eklediğinizden emin olun.

