ValueConverters.NET icon indicating copy to clipboard operation
ValueConverters.NET copied to clipboard

[Bug]The Debug.WriteLine in DebugConverter was deleted in the Nuget Package

Open zmrbak opened this issue 2 years ago • 1 comments

Source Code:

namespace ValueConverters { public class DebugConverter : SingletonConverterBase<DebugConverter> { protected override object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { Debug.WriteLine("DebugConverter.Convert(value={0}, targetType={1}, parameter={2}, culture={3}", value ?? "null", (object)targetType ?? "null", parameter ?? "null", (object)culture ?? "null");

        return value;
    }

    protected override object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        Debug.WriteLine("DebugConverter.ConvertBack(value={0}, targetType={1}, parameter={2}, culture={3}",
             value ?? "null",
             (object)targetType ?? "null",
             parameter ?? "null",
             (object)culture ?? "null");

        return value;
    }
}

}

The Decompiled code of DebugConverter in the Nuget Package:

namespace ValueConverters { public class DebugConverter : SingletonConverterBase<DebugConverter> { protected override object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return value; }

    protected override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        return value;
    }
}

}

zmrbak avatar Jul 06 '23 09:07 zmrbak

Ahhh. I see the problem. We compile in RELEASE mode which removes all calls to Debug.*

I will use something similar to what‘s proposee here: https://stackoverflow.com/a/9987984

thomasgalliker avatar Jul 06 '23 14:07 thomasgalliker