LoadWithDotNetCore – PB Docs 2022

LoadWithDotNetCore

PowerScript function

Description

Loads a .NET Core assembly.

Note

In PowerBuilder 2022 R2 and later, you should upgrade your .NET
Core assembly to .NET 6.0 assembly and use the LoadWithDotNet function
instead.

PowerBuilder 2022 R2 and later supports .NET only (.NET
Framework
and .NET Core have
been removed since Version 2022 R2).

Applies to

DotNetAssembly

Syntax

Argument

Description

objectname

The name of the DotNetAssembly object.

assemblypath

The name and location of the .NET assembly (*.dll).

The location can be an absolute path or a relative path.
When a relative path is executed in the development environment,
it is relative to the location of the PBT file; when a relative
path is executed in the production environment, it is relative
to the installation location of the application’s executable
file.

dotnetcoreversion (optional)

The highest .NET Core version to be supported. 2.1 and
later versions are supported. For example, if the value is 3, it
supports 3.x, the latest release for version 3 which is
currently installed on the machine. If the value is not
specified, it supports the latest version currently installed on
the machine.

Return value

Integer.

Returns values as follows. If any argument’s value is null, the
method returns null.

1 — Success.

-1 — Unknown error.

-2 — Could not find the assembly.

-3 — It’s not a valid assembly.

-4 — The assembly requires a dependent assembly.

-19 — Cannot find the .NET Core runtime.

-20 — Failed to load the .NET Core virtual machine.

Usage

If an application uses LoadWithDotNetCore and LoadWithDotNet at the
same time, the .NET Runtime cannot be the same version, otherwise the
subsequent execution will fail to load. You need to specify different
versions of the .NET Runtime. For the LoadWithDotNetCore function, the
version can be specified by using the dotnetcoreversion argument.

Examples

The following example loads a DLL with .NET Core 2.1.6:

See also

CreateInstance

GetDotNetCoreVersion

LoadWithDotNet

LoadWithDotNetFramework

PostEvent

TriggerEvent

TriggerEvent (.NET
method)


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x