Db2

Db2

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
Expand all | Collapse all

File not found error coming back from Azure Function App

  • 1.  File not found error coming back from Azure Function App

    Posted Wed October 07, 2020 05:14 AM

    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


  • 2.  RE: File not found error coming back from Azure Function App
    Best Answer

    Posted Wed October 07, 2020 09:08 PM

    Just some more information for others coming across the same issue in azure functions, the issue was related to the default azure function setting using 32 Bit platform. In the Azure function app, go to configuration > General settings and switching the platform to 64 bit resolved the above error.






    #Db2
    #Support
    #SupportMigration