public COMService() { InitializeComponent(); // Initialize COM security int hResult = COMNative.CoInitializeSecurity( IntPtr.Zero, // Add your security descriptor here -1, IntPtr.Zero, IntPtr.Zero, RPC_C_AUTHN_LEVEL.PKT_PRIVACY, RPC_C_IMP_LEVEL.IDENTIFY, IntPtr.Zero, EOLE_AUTHENTICATION_CAPABILITIES.DISABLE_AAA | EOLE_AUTHENTICATION_CAPABILITIES.SECURE_REFS | EOLE_AUTHENTICATION_CAPABILITIES.NO_CUSTOM_MARSHAL, IntPtr.Zero); if (hResult != 0) { throw new ApplicationException( "CoIntializeSecurity failed w/err 0x" + hResult.ToString("X")); } }