LoadWithDotNetCore
PowerScript function
Description
Loads a .NET Core assembly.
Applies to
DotNetAssembly objects
Syntax
|
1 |
objectname.LoadWithDotNetCore ( readonly string assemblypath {, string dotnetcoreversion }) |
|
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. |
|
dotnetcoreversion (optional) |
The highest .NET Core version to be supported. 2.1 and |
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.
Examples
The following example loads a DLL with .NET Core 2.1.6:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
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") //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 |
See also