Microsoft KB Archive/884378

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

Article ID: 884378

Article Last Modified on 12/4/2007

-

APPLIES TO


 * Microsoft Host Integration Server 2004 Standard Edition

-





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 &quot;System.InvalidCastException&quot; occurred in Microsoft.visualbasic.dll

An unhandled exception of type &quot;System.MissingMemberException&quot; 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 &quot;No such method&quot; 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.

Additional query words: HIS2004 HIS

Keywords: kbtshoot kbprb KB884378

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.