Home
Use the LoadWithDotNet function instead of LoadWithDotNetFramework and LoadWithDotNetCore functions
Description
Upgrade your .NET assembly to .NET 6.0 assembly and use the LoadWithDotNet function instead of LoadWithDotNetFramework and LoadWithDotNetCore functions, you must first ensure that your assembly is compatible with .NET 6.0. Once you have verified compatibility, you can use the LoadWithDotNet function to load the assembly into the PowerBuilder application. The LoadWithDotNet function is designed to work with .NET 6.0 assemblies, and it is a more efficient and reliable way to load assemblies compared to the LoadWithDotNetFramework and LoadWithDotNetCore functions.
Key Benefits
- Faster Performance: Upgrade your .NET assembly to .NET 6.0 assembly and use the LoadWithDotNet function instead of LoadWithDotNetFramework and LoadWithDotNetCore functions for faster performance.
- Improved Security: The LoadWithDotNet function provides improved security for your .NET 6.0 assembly compared to the LoadWithDotNetFramework and LoadWithDotNetCore functions.
- Better Compatibility: The LoadWithDotNet function is more compatible with other .NET 6.0 assemblies than the LoadWithDotNetFramework and LoadWithDotNetCore functions.
Non-compliant Code Example
global function void loadDotNetDLLSample ();
Long ll_return
String ls_dll
DotNetAssembly lcs_ass
//Specifies a DLL in the relative path
Ls_dll = "Appeon.Simple.dll"
//Instantiates the DotNetAssembly object
Lcs_ass = create DotNetAssembly
//Loads the DLL
Ll_return = lcs_ass.LoadWithDotNetFramework(ls_dll) //Non compliant code
//Checks the result
If ll_return < 0 then
Messagebox("Load "+ls_dll+" Failed", lcs_ass.ErrorText)
Return ll_return
End if
end function
global function void loadDotNetDLLSample2 ();
Long ll_return
String ls_dll
DotNetAssembly lcs_ass
//Specifies a DLL in the relative path
ls_dll = "Appeon.Simple.dll"
//Instantiates the DotNetAssembly object
lcs_ass = create DotNetAssembly
//Loads the DLL with .NET Core 2.1.6
ll_return = lcs_ass.LoadWithDotNetCore(ls_dll,"2.1.6") //Non compliant code
//Loads the DLL with the most curret .NET Core version on this machine
//ll_return = lcs_ass.LoadWithDotNetCore(ls_dll)
//Checks the result
If ll_return < 0 then
Messagebox("Load "+ls_dll+" Failed", lcs_ass.ErrorText)
Return ll_return
End if
end function