diff --git a/.globalconfig b/.globalconfig index af8d90c09d6..0dfe9321afd 100644 --- a/.globalconfig +++ b/.globalconfig @@ -128,7 +128,7 @@ dotnet_diagnostic.CA1063.severity = none dotnet_diagnostic.CA1064.severity = none # CA1065: Do not raise exceptions in unexpected locations -dotnet_diagnostic.CA1065.severity = none +dotnet_diagnostic.CA1065.severity = warning # CA1066: Implement IEquatable when overriding Object.Equals dotnet_diagnostic.CA1066.severity = none diff --git a/src/System.Management.Automation/engine/Attributes.cs b/src/System.Management.Automation/engine/Attributes.cs index 3ed6ea89380..c3586afb7f0 100644 --- a/src/System.Management.Automation/engine/Attributes.cs +++ b/src/System.Management.Automation/engine/Attributes.cs @@ -1618,6 +1618,7 @@ public sealed class ValidateSetAttribute : ValidateEnumeratedArgumentsAttribute /// /// Gets the valid values in the set. /// + [SuppressMessage("Design", "CA1065:Do not raise exceptions in unexpected locations", Justification = "")] public IList ValidValues { get diff --git a/src/System.Management.Automation/engine/MshMemberInfo.cs b/src/System.Management.Automation/engine/MshMemberInfo.cs index 88379f261d2..2e65af0b87e 100644 --- a/src/System.Management.Automation/engine/MshMemberInfo.cs +++ b/src/System.Management.Automation/engine/MshMemberInfo.cs @@ -6,6 +6,7 @@ using System.Collections.ObjectModel; using System.Collections.Specialized; using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using System.Management.Automation.Internal; @@ -875,6 +876,7 @@ public override PSMemberInfo Copy() /// /// When getting and there is no getter or when the getter throws an exception. /// When setting and there is no setter or when the setter throws an exception. + [SuppressMessage("Design", "CA1065:Do not raise exceptions in unexpected locations", Justification = "")] public override object Value { get @@ -964,6 +966,7 @@ public override object Value /// Gets the type of the value for this member. /// /// If there is no property getter. + [SuppressMessage("Design", "CA1065:Do not raise exceptions in unexpected locations", Justification = "")] public override string TypeNameOfValue { get @@ -1786,6 +1789,7 @@ public override PSMemberInfo Copy() /// /// When setting and there is no setter, /// when the setter throws an exception or when there is no Runspace to run the script. + [SuppressMessage("Design", "CA1065:Do not raise exceptions in unexpected locations", Justification = "")] public override object Value { get