Bug 7502

LoadWithDotNetCore locks the DLL 18 November, 2021

Sören Thomas
15 November, 2021
Product: PowerBuilder Category: Runtime
Version: 2019 R2 Build: 2328
Classification: Publishing: Public
Priority: P3
Status: Analyzing Reason:
Communication Status: Waiting for Customer
Chris Pollach @Appeon 15 November, 2021
#1
Hi Sören;

  Please try either the latest PB2019R3 build 2728 or the new PB2021 as there have been improvements to the LoadWithDotNetXxxxx commands. Also, R3 is the Long Term support version for the PB2019 series.

Regards ... Chris
Sören Thomas 15 November, 2021
*Phenomenon:

DLLs loaded via LoadWithDotNetCore are locked. This means the application can not be run multiple times at once.

*Reproduce Steps:

1. Implement loading of a DLL with LoadWithDotNetCore
	iu_assembly = CREATE DotNetAssembly
	ll_status = iu_assembly.LoadWithDotNetCore(ls_assembly_path)
	iu_dotnet_object = CREATE DotNetObject
	ll_status = iu_assembly.CreateInstance(is_class_name, iu_dotnet_object)
2. Build the application
3. Run the built exe and get to the part where the DLL is loaded
4. Keep the application open
    The DLL is locked and can not be loaded by another application. This can also be verified in the Windows File Explorer by trying to delete it.

Remarks:

With .NET Framework DLLs (LoadWithDotNetFramework) this issue does not happen in built applications (only from the PowerBuilder IDE, as stated in the documentation of LoadWithDotNetFramework). This is a viable workaround in our case, otherwise this would have a higher priority.
OS:
Windows 10
Platform:
32-bit
Database Type:
Database Version: