You receive an ambiguous "Unhandled exception" error message if you incorrectly use the Context Array parameter in a Host Integration Server 2004 Transaction Integrator (TI) method call (884378)



The information in this article applies to:

  • Microsoft Host Integration Server 2004

SYMPTOMS

In the Microsoft Host Integration Server 2004 Transaction Integrator (TI), if you use the Context Array parameter incorrectly in a TI method call, you receive ambiguous error messages that are similar to the following:
An unhandled exception of type "System.InvalidCastException" occurred in Microsoft.visualbasic.dll

An unhandled exception of type "System.MissingMemberException" occurred in Microsoft visualbasic.dll

CAUSE

This behavior occurs because the Context Array parameter is not used correctly in code. The error messages do not identify the specific source of the coding problem.

You receive one of these error messages when you use the Context Array parameter by using one of the following methods:
  • You reference the Microsoft .NET Framework version of the Microsoft.HostIntegration.TI.ClientContext.dll library.
  • You use Microsoft Component Object Model (COM) Interop and make a COM reference to the ComtiContext.dll library.

MORE INFORMATION

Host Integration Server 2004 TI enables a Microsoft Windows program to access mainframe or AS/400 programs. You can use ClientContext to pass user name and password data directly in the datastream to the host by supplying the data in a Context Array parameter. The online Help files document this feature. If the Context Array parameter is missing, you will receive a "No such method" message from the .NET runtime. This behavior occurs because the number of parameters in the code does not match the number of parameters in the assembly. Therefore, a matching method call is not found. Alternatively, if the .NET runtime finds a method with the correct name with the correct number of parameters, but the .NET runtime cannot match the type of one of the parameters to the Assembly definitions, you receive a parameter mismatch error message.

To avoid coding the Context Array parameter incorrectly, you may want to reference the TI object in the project and use early binding. This will enable using Microsoft IntelliSense to display the expected parameters and data types. Incorrect coding will cause compilation errors instead of runtime errors. If you want to use late binding, you may modify the code to use late binding after the ClientContext code is written and tested.

For more information, see the Host Integration Server 2004 online Help.

Modification Type:MajorLast Reviewed:9/16/2004
Keywords:kbtshoot kbprb KB884378 kbAudDeveloper