Managed .NET C# Example

  1. Include Public methods in the Segment class, for example, AddCustomer().

  2. If you need to call public methods from another AB Suite system, then you need to first register the generated dlls into the GAC. You do not need to do this if calling public methods from languages like C#.

    • Gacutil -i <system>.dll

    • Gacutil -i <system>ComManager.dll

    • Gacutil -i <system><shortId>_IF.dll

    • Gacutil -i <system><shortId>-<n>.dll

    where <system> is the system name, <shortId> is a two or three character identifier generated by ABS, and <n> is an incrementing number that identifies each of the system dll's generated by AB Suite.

  3. In your C# project, add references to the various assemblies and components that you need when calling your application. As a minimum, you need to add the following:

    • Interop.NGLINCX64.dll (from <AB Suite Installation folder>\bin64 folder)

    • System.EnterpriseServices (.NET assembly)

    • Unisys.AgileBusiness.RuntimeFramework.dll (from <AB Suite Installation folder>\bin64 folder)

    • <segment>.dll (from your deployed application folder)

    • <segmentComManager>.dll (from your deployed application folder)

  4. Register the type library for the system using the RegTypeLib.exe utility. The TLB file is called “<system_name>_.tlb” and is located in the Core\Bin folder of the deployed system.

    Note: By default, the TLB file name is the system name followed by an underscore.

    For example:

    C:\Program Files\Unisys\AB Suite 7.0 \Bin64\RegTypeLib.exe -register C:\Sample\Release_Windows\Sample\Core\Bin\Sample_.tlb

  5. Create an instance of the segment:

    I_Sample mySample = new SampleCOMManager() as I_Sample ;

    Call the method:

    string CustomerId = "123456";
    string CustName = "John Smith";
    mySample.AddCustomer( CustomerId, CustName );