Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

Silk Performer reports DOTNET: 3 - Loading object throw exception!

Silk Performer reports DOTNET: 3 - Loading object throw exception!

Silk Performer uses a strict method when calling assemblies. If a valid path is not provided it will report the error 'DOTNET: 3 - Loading object throw exception! Possible reasons: Wrong version of perfdotnetfw.dll, unhandled exception in constructor or insufficient permissions!'

Below is a sample script using GetDataFilePath which ensures a valid path is provided.

var
  ghTestObj : number;
  gsFileName : string;
 
dcltrans
  transaction TInit
  begin
    DotNetSetOption(DOTNET_OPT_REDIRECT_CONSOLE, 1);
    // ==============================================
    // TestClass imported as normal .NET Class
    // ==============================================
    GetDataFilePath("SomeAssembly.dll", gsFileName);
    ghTestObj := DotNetLoadObject(gsFileName, "SomeAssembly.SomeClass", "SomeAssembly.SomeClass");
  end TInit;
 
  transaction TMain
  var
    sValue : string;
  begin
 
    // System.Void set_Name(String value)
    DotNetSetString(ghTestObj, "myString");
    DotNetCallMethod(ghTestObj, "set_Name", NULL, NULL, "set_Name");
 
    // System.String get_Name()
    DotNetCallMethod(ghTestObj, "get_Name", NULL, NULL, "get_Name");
    // DotNetGetString(ghTestObj, sValue);
  end TMain;
 
  transaction TEnd
  begin
    DotNetFreeObject(ghTestObj);
  end TEnd;

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2015-03-09 10:35
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.