"Argument type 'ushort' is not CLS-compliant"


i have class opens usb device using pid , vid.  these values traditionally unsigned shorts (16bit unsigned).  made static function creating device uint16 arguments , compiler warning telling me uint16s not cls compliant.  ("argument type 'ushort' not cls-compliant")  i've used them in other functions without warning.  what's wrong this?

public class device : system.idisposable
{
    public static device opendevice(uint16 vid, uint16 pid)
    {}
}

it means not cls compliant languages have support type. therefore must either mark assembly being not cls compliant or use data type int32:



.NET Framework  >  Common Language Runtime Internals and Architecture



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'