Hello PowerBuilder experts, following is my scenario.
- We have a PowerBuilder application (version 2022 build 1892)
- We have a bunch of PDFs stored in Azure Blob Store
- We also have a C# DLL (.NETCore 6.0), that uses Azure Blob SDK to upload and download documents from the Azure Blob Store
- I am trying to integrate this C# DLL with PowerBuilder (using .NET DLL Import)
- It works perfectly in the PowerBuilder Development Environment
- But when I do a build and copy the build to the client PC, it does not work
- On further investigation i found out that LoadWithDotNetCore throws -19
- My sample code attached.
- Client PC has following versions of .NETCore
- Microsoft.NETCore.App 3.1.32
- Microsoft.NETCore.App 6.0.16
- Microsoft.WindowsDesktop.App
- Microsoft.WindowsDesktop.App
Any help will be greatly appreciated.
This.of_ResetError( )
If This.ib_objectCreated Then Return True // Already created => DONE
Long ll_status
String ls_action
integer li_fp
string ls_version
/* Load assembly using .NET Core */
ls_action = 'Load ' + This.is_AssemblyPath
DotNetAssembly lnv_assembly
lnv_assembly = Create DotNetAssembly
ll_status = lnv_assembly.LoadWithDotNetCore(This.is_AssemblyPath) // NOTE: returns 1 in my local machine and returns -19 in client machine
ls_version = lnv_assembly.getdotnetcoreversion( ) // NOTE: returns 7.0.5 in my local machine and returns EMPTY STRING in client machine
This.is_AssemblyPath + ', ll_status = ' + string( ll_status))
/* Abort when load fails */
If ll_status <> 1 Then
This.of_SetAssemblyError(This.LOAD_FAILURE, ls_action, ll_status, lnv_assembly.ErrorText)
Return False // Load failed => ABORT
End If
/* Create .NET object */
ls_action = 'Create ' + This.is_ClassName
ll_status = lnv_assembly.CreateInstance(is_ClassName, This)
ls_version = lnv_assembly.getdotnetcoreversion( )
/* Abort when create fails */
If ll_status <> 1 Then
This.of_SetAssemblyError(This.CREATE_FAILURE, ls_action, ll_status, lnv_assembly.ErrorText)
Return False // Load failed => ABORT
End If
This.ib_objectCreated = True
Return True