Skip to content

Commit 640d3ea

Browse files
Disable CA2252 in runtime (#56039)
1 parent ba08d9a commit 640d3ea

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

eng/CodeAnalysis.ruleset

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@
176176
<Rule Id="CA2249" Action="Warning" /> <!-- Consider using 'string.Contains' instead of 'string.IndexOf' -->
177177
<Rule Id="CA2250" Action="Warning" /> <!-- Use 'ThrowIfCancellationRequested' -->
178178
<Rule Id="CA2251" Action="Warning" /> <!-- Use 'string.Equals' -->
179+
<Rule Id="CA2252" Action="None" /> <!-- This API requires opting into preview features -->
179180
<Rule Id="CA2300" Action="None" /> <!-- Do not use insecure deserializer BinaryFormatter -->
180181
<Rule Id="CA2301" Action="None" /> <!-- Do not call BinaryFormatter.Deserialize without first setting BinaryFormatter.Binder -->
181182
<Rule Id="CA2302" Action="None" /> <!-- Ensure BinaryFormatter.Binder is set before calling BinaryFormatter.Deserialize -->

eng/CodeAnalysis.test.ruleset

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@
172172
<Rule Id="CA2248" Action="None" /> <!-- Provide correct 'enum' argument to 'Enum.HasFlag' -->
173173
<Rule Id="CA2249" Action="None" /> <!-- Consider using 'string.Contains' instead of 'string.IndexOf' -->
174174
<Rule Id="CA2250" Action="None" /> <!-- Use 'ThrowIfCancellationRequested' -->
175-
<Rule Id="CA2251" Action="None" /> <!-- Use 'string.Equals' -->
175+
<Rule Id="CA2251" Action="None" /> <!-- Use 'string.Equals' -->
176+
<Rule Id="CA2252" Action="None" /> <!-- This API requires opting into preview features -->
176177
<Rule Id="CA2300" Action="None" /> <!-- Do not use insecure deserializer BinaryFormatter -->
177178
<Rule Id="CA2301" Action="None" /> <!-- Do not call BinaryFormatter.Deserialize without first setting BinaryFormatter.Binder -->
178179
<Rule Id="CA2302" Action="None" /> <!-- Ensure BinaryFormatter.Binder is set before calling BinaryFormatter.Deserialize -->

0 commit comments

Comments
 (0)