Skip to content

Commit fe6f259

Browse files
committed
Switch InternalDataKind to use GetString instead of the default ToString to resolve difference in Enum serialization between .NET 6 and .NET 8.
1 parent 5832978 commit fe6f259

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Microsoft.ML.Core/CommandLine/CmdParser.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using System.Linq;
1111
using System.Reflection;
1212
using System.Text;
13+
using Microsoft.ML.Data;
1314
using Microsoft.ML.Internal.Utilities;
1415
using Microsoft.ML.Runtime;
1516

@@ -2015,6 +2016,10 @@ private void AppendSettingCore(IHostEnvironment env, StringBuilder sb, object va
20152016
var buffer = new StringBuilder();
20162017
sb.Append(GetString(env, value, buffer));
20172018
}
2019+
else if (value is InternalDataKind)
2020+
{
2021+
sb.Append(((InternalDataKind)value).GetString());
2022+
}
20182023
else
20192024
sb.Append(value.ToString());
20202025
}

0 commit comments

Comments
 (0)