Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

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

↑ Back to the top


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.

↑ Back to the top


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.

↑ Back to the top


Keywords: KB884378, kbprb, kbtshoot

↑ Back to the top

Article Info
Article ID : 884378
Revision : 2
Created on : 12/4/2007
Published on : 12/4/2007
Exists online : False
Views : 373