Skip to content

Commit 02e8349

Browse files
committed
Fix GlobalCounterOptions ValidationResult
1 parent 3b90099 commit 02e8349

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Microsoft.Diagnostics.Monitoring.Options/GlobalCounterOptions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ public IEnumerable<ValidationResult> Validate(ValidationContext validationContex
6464
{
6565
// We prefix the validation error with the provider.
6666
results.AddRange(providerResults.Select(r => new ValidationResult(
67-
string.Format(CultureInfo.CurrentCulture, OptionsDisplayStrings.ErrorMessage_NestedProviderValidationError, provider, r.ErrorMessage))));
67+
string.Format(CultureInfo.CurrentCulture, OptionsDisplayStrings.ErrorMessage_NestedProviderValidationError, provider, r.ErrorMessage),
68+
[nameof(Providers)])));
6869
}
6970
}
7071
}

src/Tools/dotnet-monitor/CollectionRules/Options/Actions/CollectTraceOptions.Validate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext vali
8181
}
8282
catch (OptionsValidationException e)
8383
{
84-
results.AddRange(e.Failures.Select((string failure) => new ValidationResult(e.Message)));
84+
results.AddRange(e.Failures.Select((string failure) => new ValidationResult(e.Message, [e.OptionsType.Name])));
8585
}
8686

8787
// Validate that each provider is valid.

0 commit comments

Comments
 (0)