I have developed a fairly extensive app using USB Client CDC. During development I used:
cdc = USBClientController.StandardDevices.StartCDC_WithDebugging();
Once this was working, I tried replacing it with:
cdc = USBClientController.StandardDevices.StartCDC();
This is the only difference between the two versions. My app also has a flashing LED (toggled on a Timer callback) and a message on a serial LCD display which is loaded from the Main() routine in the program.
The WithDebugging version works fine - when I interrupt the USB connection (to cycle the power) I can see, in Device Manager, first the “GHI.NET Micro Framework USB Debugging Interface” and then “CDC Interface (Virtual COM Port)(COM6)”
However the CDC only version behaves oddly: The “Debugging Interface” appears, but the “CDC Interface” does not, and the LCD message shows, but the flashing LED does not operate. It seems that the Main routine code is running OK, but the Timer interrupt is not firing.
When I try to run this second version using “Start Debugging” in Visual Studio it gives “An unhandled exception of type ‘System.InvalidOperationException’ occurred in GHIElectronics.NETMF.USBClient.dll”.
Does using a USBC interface that does not support debugging require debugging to be switched over to the serial port even when running stand-alone (i.e. with a Release build and without Visual Studio)? If this is the problem, surely this restriction is unnecessary because the original USB “Debugging Interface” is still available up to the point where the application code initialises another interface?