From 119c63b30b21a098625c511f200212276870ad6e Mon Sep 17 00:00:00 2001 From: Rasmus Wulff Jensen Date: Fri, 9 Jan 2026 07:37:19 +0100 Subject: [PATCH] Fix AI Agent - DebuggerDisplay using a non-existing Property --- dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgent.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgent.cs b/dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgent.cs index afed5d1518..eae21955b4 100644 --- a/dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgent.cs +++ b/dotnet/src/Microsoft.Agents.AI.Abstractions/AIAgent.cs @@ -19,7 +19,7 @@ namespace Microsoft.Agents.AI; /// and process user requests. An agent instance may participate in multiple concurrent conversations, and each conversation /// may involve multiple agents working together. /// -[DebuggerDisplay("{DisplayName,nq}")] +[DebuggerDisplay("{DebuggerDisplay,nq}")] public abstract class AIAgent { /// @@ -72,6 +72,9 @@ public abstract class AIAgent /// public virtual string? Description { get; } + [DebuggerBrowsable(DebuggerBrowsableState.Never)] + private string DebuggerDisplay => string.IsNullOrWhiteSpace(this.Name) ? $"Id = {this.Id}" : $"Name = {this.Name} ({this.Id})"; + /// Asks the for an object of the specified type . /// The type of object being requested. /// An optional key that can be used to help identify the target service.