Say, I want to know if there’s a debug output listener (Fez Config, for example) connected to a NETMF device. How to know that from inside the program? I always thought that Debugger.IsAttached property can be used for that, but apparently it could not:
public static void Main() {
Debug.Print(Resources.GetString(Resources.StringResources.String1));
var ledPort = new OutputPort(G400.PD18, false);
while (true) {
if (Debugger.IsAttached) ledPort.Write(true);
else ledPort.Write(false);
Debug.Print("Printing something");
Thread.Sleep(1000);
}
}
This trivial program lights up a LED if IsAttached property is true. Works if connecting Visual Studio. Does not if using Fez Config. Any ideas?..