TaskScheduler icon indicating copy to clipboard operation
TaskScheduler copied to clipboard

BinaryFormatter obsolete in .NET 8

Open BertDM opened this issue 1 year ago • 1 comments

Describe the bug

Set V1 Task Data (under TaskScheduler/TaskService/Task.cs) still uses BinaryFormatter which is obsolete in .NET 8 as described here: https://learn.microsoft.com/en-us/dotnet/core/compatibility/serialization/8.0/binaryformatter-disabled

	internal static void SetV1TaskData(ITask v1Task, object value)
	{
		if (value == null)
			v1Task.SetWorkItemData(0, null);
		else
		{
			var b = new BinaryFormatter();
			var stream = new MemoryStream();
			b.Serialize(stream, value);
			v1Task.SetWorkItemData((ushort)stream.Length, stream.ToArray());
		}
	}

BertDM avatar Nov 05 '24 14:11 BertDM

It is obsolete, but is still available even in the .NET 9.0 libraries. What, in particular, is the issue, other than a build warning?

dahall avatar Feb 26 '25 16:02 dahall