private TypeDesc GetNativeMethodParameterType(TypeDesc managedType, MarshalAsDescriptor marshalAs, InteropStateManager interopStateManager, bool isReturn, bool isAnsi)
        {
            TypeDesc nativeType;

            try
            {
                nativeType = MarshalHelpers.GetNativeMethodParameterType(managedType, marshalAs, interopStateManager, isReturn, isAnsi);
            }
            catch (NotSupportedException)
            {
                // if marshalling is not supported for this type the generated stubs will emit appropriate
                // error message. We just set native type to be same as managedtype
                nativeType = managedType;
            }
            return(nativeType);
        }