You can try to use TelemetryConfiguration.DisableTelemetry Property Something like this way..

#if DEBUG
            TelemetryConfiguration.Active.DisableTelemetry = true;
#endif