On deploying a .netcore3.1 application to an azure function app, as soon as I attempt to open a DB2Connection to run a DB2Command the function throws the following error:
[ERR] An error occurred while *** Could not load file or assembly 'IBM.Data.DB2.Core, Version=3.1.0.300, Culture=neutral, PublicKeyToken=7c307b91aa13d208'. Could not find or load a specific file. (0x80131621)
System.IO.FileLoadException: Could not load file or assembly 'IBM.Data.DB2.Core, Version=3.1.0.300, Culture=neutral, PublicKeyToken=7c307b91aa13d208'. Could not find or load a specific file. (0x80131621)
File name: 'IBM.Data.DB2.Core, Version=3.1.0.300, Culture=neutral, PublicKeyToken=7c307b91aa13d208'
---> System.IO.FileLoadException: Could not load file or assembly 'IBM.Data.DB2.Core, Version=3.1.0.300, Culture=neutral, PublicKeyToken=7c307b91aa13d208'.
at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly)
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
at Microsoft.Azure.WebJobs.Script.Description.FunctionAssemblyLoadContext.TryLoadDepsDependency(AssemblyName assemblyName, Assembly& assembly) in D:\a\1\s\src\WebJobs.Script\Description\DotNet\FunctionAssemblyLoadContext.cs:line 260
at Microsoft.Azure.WebJobs.Script.Description.FunctionAssemblyLoadContext.Load(AssemblyName assemblyName) in D:\a\1\s\src\WebJobs.Script\Description\DotNet\FunctionAssemblyLoadContext.cs:line 204
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingLoad(AssemblyName assemblyName)
at System.Runtime.Loader.AssemblyLoadContext.Resolve(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName)
I have confirmed the version of the dll in the bin directory is correct, and it certainly seems that the related dlls are present and accounted for in the bin/clidriver folder as mentioned in other threads.
Azure function is using runtime ~3 on a windows OS. Have attempted a number of configuration changes to attempt to get it working, and not sure what I'm missing.
Due to this being hosted in azure I am unable to track the dependency that is failing to confirm.
Any ideas where to look next?
Thanks in advance
#Db2#Support#SupportMigration