Hi Dojo community,
recently I have created a solution for an ad hoc data source, working with Visual Studio, DIS, NuGet etc.. An Excel workbook shall serve as data source, so I have installed and referenced the NPOI assemblies.
The solution is (successfully) published to our (on-prem) remote DMA.
The code starts to run correctly on the DMA (triggered by a dashboard query of my ad hoc data source), but when trying to open the Excel workbook it keeps throwing this exception (it's in a logfile because I have enabled a IGQI logger):
[2024-08-28 10:29:05.113 INF] [203eb0a5] [efa52175] Method ProcessFileData() called
[2024-08-28 10:29:05.113 INF] [203eb0a5] [efa52175] Try to create XSSF workbook for this file: C:\Skyline DataMiner\Documents\DataMiner Solutions\Events.xlsx
[2024-08-28 10:29:05.176 INF] [203eb0a5] [efa52175] Creation of XSSF workbook for this file: C:\Skyline DataMiner\Documents\DataMiner Solutions\Events.xlsx failed
[2024-08-28 10:29:05.192 INF] [203eb0a5] [efa52175] System.IO.FileLoadException: Could not load file or assembly 'ICSharpCode.SharpZipLib, Version=1.4.2.13, Culture=neutral, PublicKeyToken=1b03e6acf1164f73' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'ICSharpCode.SharpZipLib, Version=1.4.2.13, Culture=neutral, PublicKeyToken=1b03e6acf1164f73'
at NPOI.OpenXml4Net.OPC.ZipPackage..ctor(Stream in1, PackageAccess access)
at NPOI.OpenXml4Net.OPC.OPCPackage.Open(Stream stream, Boolean readOnly)
at NPOI.Util.PackageHelper.Open(Stream stream, Boolean readOnly)
at NPOI.XSSF.UserModel.XSSFWorkbook..ctor(Stream fileStream, Boolean readOnly)
at AdHocDataSrcExcel.ProcessFileData(String filePath)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
I have checked everything myself and the Internet would propose: Assemblies, versions, locations, references, PublicKeyTokens, etc.. for the NPOI and SharpZipLib. However, I cannot find a reason and it keeps being mysterious to me.
Below I have pasted the script's DLL reference list, just for additional information.
Could anyone help, any idea? If so, I can of course provide more information, snippets etc.
Thanks!
Jörg
System.Numerics.dll
System.ComponentModel.DataAnnotations.dll
System.Security.dll
System.Configuration.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\bouncycastle.cryptography\2.3.1\lib\net461\BouncyCastle.Cryptography.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\extendednumerics.bigdecimal\2025.1001.2.129\lib\net48\ExtendedNumerics.BigDecimal.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\mathnet.numerics.signed\5.0.0\lib\net48\MathNet.Numerics.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\system.buffers\4.5.1\lib\net461\System.Buffers.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\system.numerics.vectors\4.5.0\lib\net46\System.Numerics.Vectors.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\system.runtime.compilerservices.unsafe\5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\enums.net\4.0.1\lib\net45\Enums.NET.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\system.memory\4.5.5\lib\net461\System.Memory.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\microsoft.io.recyclablememorystream\3.0.0\lib\netstandard2.0\Microsoft.IO.RecyclableMemoryStream.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\sixlabors.fonts\1.0.1\lib\netstandard2.0\SixLabors.Fonts.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\system.security.cryptography.pkcs\6.0.3\lib\net461\System.Security.Cryptography.Pkcs.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\system.security.principal.windows\5.0.0\lib\net461\System.Security.Principal.Windows.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\system.security.accesscontrol\6.0.0\lib\net461\System.Security.AccessControl.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\system.security.cryptography.xml\6.0.1\lib\net461\System.Security.Cryptography.Xml.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\system.text.encoding.codepages\5.0.0\lib\net461\System.Text.Encoding.CodePages.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\sixlabors.imagesharp\2.1.8\lib\net472\SixLabors.ImageSharp.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\system.threading.tasks.extensions\4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\sharpziplib\1.4.2\lib\netstandard2.0\ICSharpCode.SharpZipLib.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\npoi\2.7.1\lib\net472\NPOI.Core.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\npoi\2.7.1\lib\net472\NPOI.OOXML.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\npoi\2.7.1\lib\net472\NPOI.OpenXml4Net.dll
C:\Skyline DataMiner\ProtocolScripts\DllImport\npoi\2.7.1\lib\net472\NPOI.OpenXmlFormats.dll
Hi Jörg, I believe this is caused by a known limitation where only dlls available in the "Files" folder in DataMiner can be used in ad hoc datasources, as that is where SLHelper is searching for dependencies.
The Data Exploration team is working on running GQI in a separate DxM, which should resolve this limitation. This is not yet released though, and someone of the Data Exploration team can provide more details on that.
Hi Joey, alright, that sounds like a valid reason. So I’ll wait for things to come. Thank you so far.
You could get this to work if you add the necessary dlls to the “C:Skyline DataMinerFiles” folder, but I wouldn’t recommend this on a production system as a long-term solution
Thanks Joey, yes, as a workaround I copied all related dlls flat to the “Files” folder, and now it works. Since the solution is running on a staging DMA, this is perfect for the moment. Indeed I’ll follow your recommendation not to use this workaround on a production system.
Now there is just one question left: How is the best way for me to get notice of a DxM release which would resolve the limitation?
I assume there will be a blog post once released as this is a big upcoming feature, but I already informed the PO of the domain to keep you updated.
Great support, thank you very much, Joey.
Addition: DMA version “DataMiner (10.4.7.0-14517)”