From e834698c7f563b42c8c0a1c973b8f79adc46838c Mon Sep 17 00:00:00 2001 From: vanzue Date: Tue, 2 Dec 2025 11:46:10 +0800 Subject: [PATCH] fix workspaces build --- .../WorkspacesCsharpLibrary/Data/WorkspacesEditorData`1.cs | 7 +++++++ .../WorkspacesLauncherUI/ViewModels/MainViewModel.cs | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/modules/Workspaces/WorkspacesCsharpLibrary/Data/WorkspacesEditorData`1.cs b/src/modules/Workspaces/WorkspacesCsharpLibrary/Data/WorkspacesEditorData`1.cs index f1a8b60a5b..eed73af224 100644 --- a/src/modules/Workspaces/WorkspacesCsharpLibrary/Data/WorkspacesEditorData`1.cs +++ b/src/modules/Workspaces/WorkspacesCsharpLibrary/Data/WorkspacesEditorData`1.cs @@ -28,4 +28,11 @@ public class WorkspacesEditorData { return JsonSerializer.Serialize(data, WorkspacesJsonOptions.EditorOptions); } + + [RequiresUnreferencedCode("JSON serialization uses reflection-based serializer.")] + [RequiresDynamicCode("JSON serialization uses reflection-based serializer.")] + public T Deserialize(string json) + { + return JsonSerializer.Deserialize(json, WorkspacesJsonOptions.EditorOptions)!; + } } diff --git a/src/modules/Workspaces/WorkspacesLauncherUI/ViewModels/MainViewModel.cs b/src/modules/Workspaces/WorkspacesLauncherUI/ViewModels/MainViewModel.cs index aa029d7ea2..5b358686de 100644 --- a/src/modules/Workspaces/WorkspacesLauncherUI/ViewModels/MainViewModel.cs +++ b/src/modules/Workspaces/WorkspacesLauncherUI/ViewModels/MainViewModel.cs @@ -6,13 +6,11 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; -using System.Diagnostics; using ManagedCommon; using WorkspacesCsharpLibrary; using WorkspacesLauncherUI.Data; using WorkspacesLauncherUI.Models; -using WorkspacesLauncherUI.Utils; namespace WorkspacesLauncherUI.ViewModels {