From 712e29ef890d5dc70383861749bffceee4c31290 Mon Sep 17 00:00:00 2001 From: Rainer Sigwald Date: Fri, 27 Sep 2024 11:18:50 -0500 Subject: [PATCH] Hide and warn about TaskItem ctor The doc comment mentioned that the parameterless constructor existed only for COM but it was still easy to find, causing problems like #10660. Hide it from IDE completion and extend the comment. --- src/Utilities/TaskItem.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Utilities/TaskItem.cs b/src/Utilities/TaskItem.cs index f4e818e278e..dc1e8ee78ff 100644 --- a/src/Utilities/TaskItem.cs +++ b/src/Utilities/TaskItem.cs @@ -4,6 +4,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; #if FEATURE_SECURITY_PERMISSIONS using System.Security; @@ -60,8 +61,12 @@ public sealed class TaskItem : #region Constructors /// - /// Default constructor -- we need it so this type is COM-createable. + /// Default constructor -- do not use. /// + /// + /// This constructor exists only so that the type is COM-creatable. Prefer . + /// + [EditorBrowsable(EditorBrowsableState.Never)] public TaskItem() { _itemSpec = string.Empty;