Update SharedPerformanceCounter assert (#44333)
authorStephen Toub <stoub@microsoft.com>
Fri, 6 Nov 2020 01:07:37 +0000 (20:07 -0500)
committerGitHub <noreply@github.com>
Fri, 6 Nov 2020 01:07:37 +0000 (17:07 -0800)
src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedPerformanceCounter.cs

index 8d9dfd3..633730d 100644 (file)
@@ -697,7 +697,7 @@ namespace System.Diagnostics
                             }
                             else
                             {
-                                Debug.Assert(counterNamesObject is string[], $"Expected string[], got '{counterNamesObject}' with kind '{categoryKey.GetValueKind("Counter Names")}'for category '{_categoryName}'");
+                                Debug.Assert(counterNamesObject is string[], $"Expected string[], got '{counterNamesObject}' of type '{counterNamesObject?.GetType()}' with kind '{categoryKey.GetValueKind("Counter Names")}' for category '{_categoryName}'");
                                 string[] counterNames = (string[])counterNamesObject;
                                 for (int i = 0; i < counterNames.Length; i++)
                                     counterNames[i] = counterNames[i].ToLowerInvariant();