code-analysis471 pages
Code analysis
Microsoft’s own analyzer catalog. Every CA and IDE rule, what it wants, and how to configure it.
- Rule categories 10/04/2021
- Code quality rule configuration options 03/24/2026
- Code-style rule options 10/22/2025
- Configuration files for code analysis rules 07/07/2021
- Configuration options for code analysis 02/13/2026
- Overview of .NET source code analysis 11/05/2025
- Predefined configuration files 09/24/2020
- CA1000: Do not declare static members on generic types CA1000 03/11/2019 CSharp · VB
- CA1001: Types that own disposable fields should be disposable CA1001 12/18/2020 CSharp · VB
- CA1002: Do not expose generic lists CA1002 11/04/2016
- CA1003: Use generic event handler instances CA1003 03/11/2019 CSharp · VB
- CA1005: Avoid excessive parameters on generic types CA1005 06/11/2020 CSharp
- CA1008: Enums should have zero value CA1008 03/11/2019 CSharp · VB
- CA1010: Collections should implement generic interface CA1010 03/11/2019
- CA1012: Abstract types should not have public constructors CA1012 03/11/2019 CSharp · VB
- CA1014: Mark assemblies with CLSCompliantAttribute CA1014 11/04/2016 CSharp · VB
- CA1016: Mark assemblies with AssemblyVersionAttribute CA1016 11/04/2016 CSharp · VB
- CA1017: Mark assemblies with ComVisibleAttribute CA1017 11/04/2016 CSharp · VB
- CA1018: Mark attributes with AttributeUsageAttribute CA1018 11/04/2016 CSharp · VB
- CA1019: Define accessors for attribute arguments CA1019 11/04/2016 CSharp · VB
- CA1021: Avoid out parameters CA1021 11/04/2016
- CA1024: Use properties where appropriate CA1024 12/21/2020 CSharp · VB
- CA1027: Mark enums with FlagsAttribute CA1027 03/11/2019
- CA1028: Enum storage should be Int32 CA1028 03/11/2019 CSharp · VB
- CA1030: Use events where appropriate CA1030 03/11/2019 CSharp
- CA1031: Do not catch general exception types CA1031 11/04/2016 CSharp · VB
- CA1032: Implement standard exception constructors CA1032 11/04/2016
- CA1033: Interface methods should be callable by child types CA1033 11/04/2016
- CA1034: Nested types should not be visible CA1034 11/04/2016 CSharp · VB
- CA1036: Override methods on comparable types CA1036 03/11/2019 CSharp · VB
- CA1040: Avoid empty interfaces CA1040 03/11/2019 CSharp · VB
- CA1041: Provide ObsoleteAttribute message CA1041 03/11/2019 CSharp · VB
- CA1043: Use integral or string argument for indexers CA1043 03/11/2019 CSharp · VB
- CA1044: Properties should not be write only CA1044 03/11/2019 CSharp · VB
- CA1045: Do not pass types by reference CA1045 11/04/2016
- CA1046: Do not overload operator equals on reference types CA1046 11/04/2016
- CA1047: Do not declare protected members in sealed types CA1047 06/11/2020 CSharp · VB
- CA1050: Declare types in namespaces CA1050 11/04/2016 CSharp · VB
- CA1051: Do not declare visible instance fields CA1051 03/11/2019
- CA1052: Static holder types should be Static or NotInheritable CA1052 07/25/2019 CSharp · VB
- CA1053: Static holder types should not have default constructors CA1053 11/04/2016
- CA1054: URI parameters should not be strings CA1054 03/11/2019 CSharp · VB
- CA1055: URI return values should not be strings CA1055 03/11/2019 CSharp · VB
- CA1056: URI properties should not be strings CA1056 03/11/2019 CSharp · VB
- CA1058: Types should not extend certain base types CA1058 03/11/2019
- CA1060: Move P/Invokes to NativeMethods class CA1060 11/04/2016 CSharp · VB
- CA1061: Do not hide base class methods CA1061 11/04/2016
- CA1062: Validate arguments of public methods CA1062 12/18/2020 CSharp · VB
- CA1063: Implement IDisposable correctly CA1063 11/09/2022 CSharp
- CA1064: Exceptions should be public CA1064 11/04/2016
- CA1065: Do not raise exceptions in unexpected locations CA1065 11/04/2016
- CA1066: Implement IEquatable when overriding Equals CA1066 04/23/2020
- CA1067: Override Equals when implementing IEquatable CA1067 04/23/2020
- CA1068: CancellationToken parameters must come last CA1068 09/16/2019
- CA1069: Enums should not have duplicate values CA1069 09/16/2019
- CA1070: Do not declare event fields as virtual CA1070 04/30/2020
- CA1200: Avoid using cref tags with a prefix CA1200 09/16/2019
- CA1303: Do not pass literals as localized parameters CA1303 11/04/2016 CSharp · VB
- CA1304: Specify CultureInfo CA1304 06/30/2018
- CA1305: Specify IFormatProvider CA1305 07/17/2023 CSharp
- CA1307: Specify StringComparison for clarity CA1307 11/04/2016
- CA1308: Normalize strings to uppercase CA1308 11/04/2016
- CA1309: Use ordinal StringComparison CA1309 11/04/2016
- CA1310: Specify StringComparison for correctness CA1310 08/26/2020
- CA1311: Specify a culture or use an invariant version CA1311 11/16/2022 CSharp · VB
- CA1401: P/Invokes should not be visible CA1401 11/04/2016 CSharp · VB
- CA1416: Validate platform compatibility CA1416 09/20/2021
- CA1417: Do not use `OutAttribute` on string parameters for P/Invokes CA1417 07/20/2020
- CA1418: Validate platform compatibility CA1418 08/31/2021
- CA1419: Provide a parameterless constructor that is as visible as the containing type for concrete types derived from 'System.Runtime.InteropServices.SafeHandle' CA1419 01/19/2022
- CA1420: Property, type, or attribute requires runtime marshalling CA1420 11/03/2022 CSharp · VB
- CA1421: Method uses runtime marshalling when DisableRuntimeMarshallingAttribute is applied CA1421 11/16/2022 CSharp · VB
- CA1422: Validate platform compatibility - obsoleted APIs CA1422 11/03/2022 CSharp · VB
- CA1501: Avoid excessive inheritance CA1501 11/09/2022 CSharp · VB
- CA1502: Avoid excessive complexity CA1502 11/09/2022 CSharp · VB
- CA1505: Avoid unmaintainable code CA1505 11/09/2022
- CA1506: Avoid excessive class coupling CA1506 11/09/2022
- CA1507: Use `nameof` in place of string CA1507 12/14/2023
- CA1508: Avoid dead conditional code CA1508 04/23/2020
- CA1509: Invalid entry in code metrics configuration file CA1509 09/10/2026
- CA1510: Use ArgumentNullException throw helper CA1510 11/16/2023
- CA1511: Use ArgumentException throw helper CA1511 11/16/2023
- CA1512: Use ArgumentOutOfRangeException throw helper CA1512 11/16/2023
- CA1513: Use ObjectDisposedException throw helper CA1513 11/16/2023
- CA1514: Avoid redundant length argument CA1514 09/23/2023
- CA1515: Consider making public types internal CA1515 06/04/2025
- CA1516: Use cross-platform intrinsics CA1516 07/09/2025
- CA1700: Do not name enum values 'Reserved' CA1700 11/04/2016 CSharp
- CA1707: Identifiers should not contain underscores CA1707 11/04/2016 CSharp
- CA1708: Identifiers should differ by more than case CA1708 12/08/2022
- CA1710: Identifiers should have correct suffix CA1710 06/11/2020
- CA1711: Identifiers should not have incorrect suffix CA1711 07/21/2020
- CA1712: Do not prefix enum values with type name CA1712 11/04/2016 CSharp · VB
- CA1713: Events should not have before or after prefix CA1713 11/04/2016 CSharp
- CA1714: Flags enums should have plural names CA1714 03/11/2019
- CA1715: Identifiers should have correct prefix CA1715 03/11/2019 CSharp · VB
- CA1716: Identifiers should not match keywords CA1716 03/11/2019 CSharp
- CA1717: Only FlagsAttribute enums should have plural names CA1717 03/11/2019
- CA1720: Identifiers should not contain type names CA1720 03/11/2019 CSharp
- CA1721: Property names should not match get methods CA1721 03/11/2019 CSharp · VB
- CA1724: Type names should not match namespaces CA1724 07/21/2020
- CA1725: Parameter names should match base declaration CA1725 03/11/2019 CSharp
- CA1727: Use PascalCase for named placeholders CA1727 01/19/2022 CSharp
- CA1801: Review unused parameters CA1801 06/24/2019
- CA1802: Use Literals Where Appropriate CA1802 03/11/2019 CSharp · VB
- CA1805: Do not initialize unnecessarily CA1805 06/29/2020
- CA1806: Do not ignore method results CA1806 10/30/2025 CSharp · VB
- CA1810: Initialize reference type static fields inline CA1810 11/04/2016 CSharp · VB
- CA1812: Avoid uninstantiated internal classes CA1812 05/19/2023
- CA1813: Avoid unsealed attributes CA1813 11/04/2016 CSharp · VB
- CA1814: Prefer jagged arrays over multidimensional CA1814 12/18/2020 CSharp · VB
- CA1815: Override equals and operator equals on value types CA1815 03/11/2019
- CA1816: Call GC.SuppressFinalize correctly CA1816 06/30/2018 CSharp · VB
- CA1819: Properties should not return arrays CA1819 03/11/2019 CSharp · VB
- CA1820: Test for empty strings using string length CA1820 11/04/2016
- CA1821: Remove empty finalizers CA1821 11/04/2016
- CA1822: Mark members as static CA1822 03/30/2026 CSharp
- CA1823: Avoid unused private fields CA1823 11/04/2016 CSharp
- CA1824: Mark assemblies with NeutralResourcesLanguageAttribute CA1824 12/14/2023
- CA1825: Avoid zero-length array allocations CA1825 11/09/2022
- CA1826: Use property instead of Linq Enumerable method CA1826 12/07/2022
- CA1827: Do not use Count()/LongCount() when Any() can be used CA1827 07/17/2023
- CA1828: Do not use CountAsync/LongCountAsync when AnyAsync can be used CA1828 04/24/2020
- CA1829: Use Length/Count property instead of Enumerable.Count method CA1829 04/24/2020
- CA1830: Prefer strongly-typed Append and Insert method overloads on StringBuilder CA1830 06/18/2020
- CA1831: Use AsSpan instead of Range-based indexers for string when appropriate CA1831 06/04/2020
- CA1832: Use AsSpan or AsMemory instead of Range-based indexers for getting ReadOnlySpan or ReadOnlyMemory portion of an array CA1832 06/04/2020
- CA1833: Use AsSpan or AsMemory instead of Range-based indexers for getting Span or Memory portion of an array CA1833 06/04/2020
- CA1834: Use StringBuilder.Append(char) for single character strings CA1834 08/04/2020
- CA1835: Prefer the memory-based overloads of ReadAsync/WriteAsync methods in stream-based classes CA1835 05/11/2020
- CA1836: Prefer IsEmpty over Count when available CA1836 06/09/2020
- CA1837: Use Environment.ProcessId instead of Process.GetCurrentProcess().Id CA1837 08/27/2020
- CA1838: Avoid `StringBuilder` parameters for P/Invokes CA1838 08/03/2020
- CA1839: Use Environment.ProcessPath instead of Process.GetCurrentProcess().MainModule.FileName CA1839 11/23/2021 CSharp · VB
- CA1840: Use Environment.CurrentManagedThreadId instead of Thread.CurrentThread.ManagedThreadId CA1840 11/23/2021 CSharp · VB
- CA1841: Prefer Dictionary Contains methods CA1841 04/21/2021
- CA1842: Do not use 'WhenAll' with a single task CA1842 01/19/2022
- CA1843: Do not use 'WaitAll' with a single task CA1843 01/19/2022
- CA1844: Provide memory-based overrides of async methods when subclassing 'Stream' CA1844 05/18/2021 CSharp
- CA1845: Use span-based 'string.Concat' CA1845 05/18/2021
- CA1846: Prefer `AsSpan` over `Substring` CA1846 05/21/2021 CSharp · VB
- CA1847: Use String.Contains(char) instead of String.Contains(string) with single characters CA1847 03/03/2021 CSharp · VB
- CA1848: Use the LoggerMessage delegates CA1848 08/04/2025
- CA1849: Call async methods when in an async method CA1849 08/27/2021
- CA1850: Prefer static `HashData` method over `ComputeHash` CA1850 10/23/2021 CSharp · VB
- CA1851: Possible multiple enumerations of `IEnumerable` collection CA1851 09/01/2022 CSharp · VB
- CA1852: Seal internal types CA1852 05/19/2023 CSharp · VB
- CA1853: Unnecessary call to 'Dictionary.ContainsKey(key)' CA1853 11/16/2022 CSharp · VB
- CA1854: Prefer the `IDictionary.TryGetValue(TKey, out TValue)` method CA1854 06/01/2022 CSharp · VB
- CA1855: Use Span<T>.Clear() instead of Span<T>.Fill() CA1855 11/16/2022 CSharp
- CA1856: Incorrect usage of ConstantExpected attribute CA1856 11/15/2023 CSharp
- CA1857: The parameter expects a constant for optimal performance CA1857 11/15/2023 CSharp
- CA1858: Use StartsWith instead of IndexOf CA1858 12/20/2022 CSharp · VB
- CA1859: Use concrete types when possible for improved performance CA1859 05/01/2023
- CA1860: Avoid using 'Enumerable.Any()' extension method CA1860 07/17/2023
- CA1861: Avoid constant arrays as arguments CA1861 05/10/2023
- CA1862: Use the 'StringComparison' method overloads to perform case-insensitive string comparisons CA1862 11/21/2023
- CA1863: Use 'CompositeFormat' CA1863 11/20/2023
- CA1864: Prefer the 'IDictionary.TryAdd(TKey, TValue)' method CA1864 06/30/2023
- CA1865-CA1867: Use 'string.Method(char)' instead of 'string.Method(string)' for string with single char CA1865-CA1867 07/27/2023
- CA1868: Unnecessary call to 'Contains' for sets CA1868 07/25/2023
- CA1869: Cache and reuse 'JsonSerializerOptions' instances CA1869 08/21/2023
- CA1870: Use a cached 'SearchValues' instance CA1870 09/12/2023
- CA1871: Do not pass a nullable struct to 'ArgumentNullException.ThrowIfNull' CA1871 02/25/2024
- CA1872: Prefer 'Convert.ToHexString' and 'Convert.ToHexStringLower' over call chains based on 'BitConverter.ToString' CA1872 03/21/2024
- CA1873: Avoid potentially expensive logging CA1873 10/27/2025
- CA1874: Use 'Regex.IsMatch' CA1874 10/27/2025
- CA1875: Use 'Regex.Count' CA1875 10/27/2025
- CA1877: Use 'Path.Combine' or 'Path.Join' overloads CA1877 11/05/2025
- CA1878: Prefer ReadOnlySpan properties over readonly array fields CA1878 08/24/2026
- CA2000: Dispose objects before losing scope CA2000 02/01/2025 CSharp · VB
- CA2002: Do not lock on objects with weak identity CA2002 01/31/2018 CSharp · VB
- CA2007: Do not directly await a Task CA2007 03/08/2019 CSharp
- CA2008: Do not create tasks without passing a TaskScheduler CA2008 08/26/2020 CSharp
- CA2009: Do not call ToImmutableCollection on an ImmutableCollection value CA2009 04/29/2020
- CA2011: Do not assign property within its setter CA2011 04/29/2020
- CA2012: Use ValueTasks correctly CA2012 06/18/2020 CSharp
- CA2013: Do not use ReferenceEquals with value types CA2013 05/27/2020
- CA2014: Do not use stackalloc in loops CA2014 06/18/2020 CSharp
- CA2015: Do not define finalizers for types derived from MemoryManager<T> CA2015 05/18/2020
- CA2016: Forward the CancellationToken parameter to methods that take one CA2016 06/18/2020
- CA2017: Parameter count mismatch CA2017 09/24/2025
- CA2018: The `count` argument to `Buffer.BlockCopy` should specify the number of bytes to copy CA2018 08/17/2021
- CA2019: `ThreadStatic` fields should not use inline initialization CA2019 11/04/2022 CSharp · VB
- CA2020: Prevent behavioral change caused by built-in operators of IntPtr/UIntPtr CA2020 10/07/2022
- CA2021: Don't call Enumerable.Cast<T> or Enumerable.OfType<T> with incompatible types CA2021 11/16/2023 CSharp · VB
- CA2022: Avoid inexact read with Stream.Read CA2022 10/26/2024 CSharp · VB
- CA2023: Invalid braces in message template CA2023 10/27/2025
- CA2024: Do not use StreamReader.EndOfStream in async methods CA2024 01/16/2025 CSharp · VB
- CA2025: Do not pass 'IDisposable' instances into unawaited tasks CA2025 05/08/2025 CSharp
- CA2026: Prefer JsonElement.Parse over JsonDocument.Parse().RootElement CA2026 11/05/2025 CSharp · VB
- CA2100: Review SQL queries for security vulnerabilities CA2100 09/24/2025 CSharp · VB
- CA2101: Specify marshalling for P/Invoke string arguments CA2101 11/04/2016 CSharp · VB
- CA2109: Review visible event handlers CA2109 11/04/2016
- CA2119: Seal methods that satisfy private interfaces CA2119 11/04/2016 CSharp · VB
- CA2153: Avoid handling Corrupted State Exceptions CA2153 02/19/2019
- CA2200: Rethrow to preserve stack details CA2200 02/15/2023 CSharp · VB
- CA2201: Do not raise reserved exception types CA2201 11/04/2016 CSharp
- CA2207: Initialize value type static fields inline CA2207 11/04/2016 CSharp
- CA2208: Instantiate argument exceptions correctly CA2208 10/24/2025 CSharp · VB
- CA2211: Non-constant fields should not be visible CA2211 11/04/2016 CSharp · VB
- CA2213: Disposable fields should be disposed CA2213 05/14/2019
- CA2214: Do not call overridable methods in constructors CA2214 05/29/2016 CSharp · VB
- CA2215: Dispose methods should call base class dispose CA2215 11/04/2016 CSharp · VB
- CA2216: Disposable types should declare finalizer CA2216 11/04/2016
- CA2217: Do not mark enums with FlagsAttribute CA2217 03/11/2019 VB · CSharp
- CA2218: Override GetHashCode on overriding Equals CA2218 11/04/2016 VB
- CA2219: Do not raise exceptions in exception clauses CA2219 11/04/2016 CSharp
- CA2224: Override Equals() on overloading operator equals CA2224 11/04/2016
- CA2225: Operator overloads have named alternates CA2225 03/11/2019 CSharp
- CA2226: Operators should have symmetrical overloads CA2226 03/11/2019
- CA2227: Collection properties should be read only CA2227 03/30/2026 CSharp · VB
- CA2229: Implement serialization constructors CA2229 11/13/2023
- CA2231: Overload operator equals on overriding ValueType.Equals CA2231 03/11/2019 CSharp · VB
- CA2234: Pass System.Uri objects instead of strings CA2234 03/11/2019 CSharp · VB
- CA2235: Mark all non-serializable fields CA2235 11/04/2016 CSharp · VB
- CA2237: Mark ISerializable types with SerializableAttribute CA2237 11/04/2016 CSharp · VB
- CA2241: Provide correct arguments to formatting methods CA2241 05/28/2020 CSharp · VB
- CA2242: Test for NaN correctly CA2242 11/04/2016 CSharp · VB
- CA2243: Attribute string literals should parse correctly CA2243 11/04/2016
- CA2244: Do not duplicate indexed element initializations CA2244 04/30/2020
- CA2245: Do not assign a property to itself CA2245 04/29/2020
- CA2246: Do not assign a symbol and its member in the same statement CA2246 04/30/2020
- CA2247: Argument passed to TaskCompletionSource constructor should be TaskCreationOptions enum instead of TaskContinuationOptions enum CA2247 05/16/2020
- CA2248: Provide correct enum argument to Enum.HasFlag CA2248 05/06/2020
- CA2249: Consider using String.Contains instead of String.IndexOf CA2249 08/27/2020
- CA2250: Use `ThrowIfCancellationRequested` CA2250 05/21/2021 CSharp · VB
- CA2251: Use `String.Equals` over `String.Compare` CA2251 05/31/2021
- CA2252: Opt in to preview features before using them CA2252 11/09/2022 CSharp
- CA2253: Named placeholders should not be numeric values CA2253 01/19/2022 CSharp
- CA2254: Template should be a static expression CA2254 11/30/2022
- CA2255: The `ModuleInitializer` attribute should not be used in libraries CA2255 11/15/2021
- CA2256: All members declared in parent interfaces must have an implementation in a DynamicInterfaceCastableImplementation-attributed interface CA2256 01/19/2022 CSharp
- CA2257: Members defined on an interface with the 'DynamicInterfaceCastableImplementationAttribute' should be 'static' CA2257 01/19/2022 CSharp
- CA2258: Providing a 'DynamicInterfaceCastableImplementation' interface in Visual Basic is unsupported CA2258 01/19/2022
- CA2259: Ensure `ThreadStatic` is only used with static fields CA2259 11/04/2022 CSharp · VB
- CA2260: Implement generic math interfaces correctly CA2260 10/06/2022
- CA2261: Do not use `ConfigureAwaitOptions.SuppressThrowing` with `Task<TResult>` CA2261 11/16/2023
- CA2262: Set 'MaxResponseHeadersLength' properly CA2262 01/30/2024
- CA2263: Prefer generic overload when type is known CA2263 02/18/2024
- CA2264: Do not pass a non-nullable value to 'ArgumentNullException.ThrowIfNull' CA2264 02/25/2024
- CA2265: Do not compare `Span<T>` to `null` or `default` CA2264 10/28/2024
- CA2266: File-based program entry point should start with `#!` CA2266 06/02/2026
- CA2267: Quote whitespace in file-based program directive values CA2267 08/21/2026
- CA2300: Do not use insecure deserializer BinaryFormatter CA2300 07/15/2020
- CA2301: Do not call BinaryFormatter.Deserialize without first setting BinaryFormatter.Binder CA2301 07/15/2020
- CA2302: Ensure BinaryFormatter.Binder is set before calling BinaryFormatter.Deserialize CA2302 07/15/2020
- CA2305: Do not use insecure deserializer LosFormatter CA2305 05/01/2019
- CA2310: Do not use insecure deserializer NetDataContractSerializer CA2310 05/01/2019
- CA2311: Do not deserialize without first setting NetDataContractSerializer.Binder CA2311 05/01/2019
- CA2312: Ensure NetDataContractSerializer.Binder is set before deserializing CA2312 05/01/2019
- CA2315: Do not use insecure deserializer ObjectStateFormatter CA2315 05/01/2019
- CA2321: Do not deserialize with JavaScriptSerializer using a SimpleTypeResolver CA2321 05/08/2019
- CA2322: Ensure JavaScriptSerializer is not initialized with SimpleTypeResolver before deserializing CA2322 05/08/2019
- CA2326: Do not use TypeNameHandling values other than None CA2326 08/20/2019
- CA2327: Do not use insecure JsonSerializerSettings CA2327 08/20/2019
- CA2328: Ensure that JsonSerializerSettings are secure CA2328 08/20/2019
- CA2329: Do not deserialize with JsonSerializer using an insecure configuration CA2329 08/20/2019
- CA2330: Ensure that JsonSerializer has a secure configuration when deserializing CA2330 08/20/2019
- CA2350: Ensure DataTable.ReadXml()'s input is trusted CA2350 07/14/2020
- CA2351: Ensure DataSet.ReadXml()'s input is trusted CA2351 08/11/2020
- CA2352: Unsafe DataSet or DataTable in serializable type can be vulnerable to remote code execution attacks CA2352 08/11/2020
- CA2353: Unsafe DataSet or DataTable in serializable type CA2353 07/14/2020
- CA2354: Unsafe DataSet or DataTable in deserialized object graph can be vulnerable to remote code execution attack CA2354 07/14/2020
- CA2355: Unsafe DataSet or DataTable in deserialized object graph CA2355 07/14/2020
- CA2356: Unsafe DataSet or DataTable type in web deserialized object graph CA2356 07/14/2020
- CA2361: Ensure autogenerated class containing DataSet.ReadXml() is not used with untrusted data CA2361 08/11/2020
- CA2362: Unsafe DataSet or DataTable in autogenerated serializable type can be vulnerable to remote code execution attacks CA2362 08/11/2020
- CA3001: Review code for SQL injection vulnerabilities CA3001 04/03/2019
- CA3002: Review code for XSS vulnerabilities CA3002 04/03/2019
- CA3003: Review code for file path injection vulnerabilities CA3003 04/03/2019
- CA3004: Review code for information disclosure vulnerabilities CA3004 04/03/2019
- CA3005: Review code for LDAP injection vulnerabilities CA3005 04/03/2019
- CA3006: Review code for process command injection vulnerabilities CA3006 04/03/2019
- CA3007: Review code for open redirect vulnerabilities CA3007 04/03/2019
- CA3008: Review code for XPath injection vulnerabilities CA3008 04/03/2019
- CA3009: Review code for XML injection vulnerabilities CA3009 07/19/2023
- CA3010: Review code for XAML injection vulnerabilities CA3010 04/03/2019
- CA3011: Review code for DLL injection vulnerabilities CA3011 04/03/2019
- CA3012: Review code for regex injection vulnerabilities CA3012 04/03/2019
- CA3061: Do not add schema by URL CA3061 08/14/2019
- CA3075: Insecure DTD Processing CA3075 03/18/2019
- CA3076: Insecure XSLT Script Execution CA3076 11/04/2016
- CA3077: Insecure Processing in API Design, XML Document and XML Text Reader CA3077 11/04/2016
- CA3147: Mark verb handlers with ValidateAntiForgeryToken CA3147 08/08/2018
- CA5350: Do Not Use Weak Cryptographic Algorithms CA5350 11/04/2016
- CA5351: Do Not Use Broken Cryptographic Algorithms CA5351 11/04/2016
- CA5358: Do Not Use Unsafe Cipher Modes CA5358 01/07/2020
- CA5359: Do not disable certificate validation CA5359 05/07/2020
- CA5360: Do not call dangerous methods in deserialization CA5360 05/27/2020
- CA5361: Do not disable SChannel use of strong crypto CA5361 07/12/2019
- CA5362: Potential reference cycle in deserialized object graph CA5362 07/29/2026
- CA5363: Do not disable request validation CA5363 08/14/2019
- CA5364: Do not use deprecated security protocols CA5364 07/12/2019
- CA5365: Do Not Disable HTTP Header Checking CA5365 04/29/2020
- CA5366: Use XmlReader For DataSet Read XML CA5366 04/30/2020
- CA5367: Do not serialize types with pointer fields CA5367 04/30/2020
- CA5368: Set ViewStateUserKey For Classes Derived From Page CA5368 05/07/2020
- CA5369: Use XmlReader for Deserialize CA5369 08/14/2019
- CA5370: Use XmlReader for validating reader CA5370 08/14/2019
- CA5371: Use XmlReader for schema read CA5371 08/14/2019
- CA5372: Use XmlReader for XPathDocument CA5372 08/14/2019
- CA5373: Do not use obsolete key derivation function CA5373 08/14/2019
- CA5374: Do not use XslTransform CA5374 04/28/2020
- CA5375: Do not use account shared access signature CA5375 05/19/2020
- CA5376: Use SharedAccessProtocol HttpsOnly CA5376 05/19/2020
- CA5377: Use container level access policy CA5377 05/19/2020
- CA5378: Do not disable ServicePointManagerSecurityProtocols CA5378 07/12/2019
- CA5379: Ensure key derivation function algorithm is sufficiently strong CA5379 05/07/2020
- CA5380: Do not add certificates to root store CA5380 08/14/2019
- CA5381: Ensure certificates are not added to root store CA5381 08/14/2019
- CA5382: Use secure cookies in ASP.NET Core CA5382 05/07/2020
- CA5383: Ensure use secure cookies in ASP.NET Core CA5383 05/07/2020
- CA5384: Do not use digital signature algorithm (DSA) CA5384 05/18/2020
- CA5385: Use Rivest–Shamir–Adleman (RSA) algorithm with sufficient key size CA5385 05/18/2020
- CA5386: Avoid hardcoding SecurityProtocolType value CA5386 07/12/2019
- CA5387: Do not use weak key derivation function with insufficient iteration count CA5387 05/08/2020
- CA5388: Ensure sufficient iteration count when using weak key derivation function CA5388 05/08/2020
- CA5389: Do not add archive item's path to the target file system path CA5389 08/14/2019
- CA5390: Do not hard-code encryption key CA5390 05/08/2020
- CA5391: Use antiforgery tokens in ASP.NET Core MVC controllers CA5391 05/27/2020
- CA5392: Use DefaultDllImportSearchPaths attribute for P/Invokes CA5392 05/28/2020
- CA5393: Do not use unsafe DllImportSearchPath value CA5393 05/28/2020
- CA5394: Do not use insecure randomness CA5394 05/08/2020
- CA5395: Miss HttpVerb attribute for action methods CA5395 05/27/2020
- CA5396: Set HttpOnly to true for HttpCookie CA5396 05/11/2020
- CA5397: Do not use deprecated SslProtocols values CA5397 08/14/2019
- CA5398: Avoid hardcoded SslProtocols values CA5398 08/14/2019
- CA5399: Enable HttpClient certificate revocation list check CA5399 05/18/2020
- CA5400: Ensure HttpClient certificate revocation list check is not disabled CA5400 05/18/2020
- CA5401: Do not use CreateEncryptor with non-default IV CA5401 05/13/2020
- CA5402: Use CreateEncryptor with the default IV CA5402 05/13/2020
- CA5403: Do not hard-code certificate CA5403 10/16/2019
- CA5404: Do not disable token validation checks CA5404 09/01/2021
- CA5405: Do not always skip token validation in delegates CA5405 09/01/2021
- Design rules 11/04/2016
- Documentation rules 09/16/2019
- Globalization rules 11/04/2016
- Code quality rules 01/31/2024
- Portability and interoperability rules 11/04/2016
- Maintainability rules 11/04/2016
- Naming rules 11/04/2016
- Performance rules 10/27/2025
- Reliability rules 10/27/2025
- Security rules 10/02/2019
- Usage rules 01/31/2024
- C# formatting options 01/30/2025 CSharp
- .NET formatting options 12/20/2022 CSharp · VB
- Simplify name (IDE0001) IDE0001 12/15/2023 CSharp · VB
- Simplify member access (IDE0002) IDE0002 09/30/2020 CSharp · VB
- Member-access qualification preferences (IDE0003 and IDE0009) IDE0003 03/24/2026 CSharp · VB
- Remove unnecessary cast (IDE0004) IDE0004 09/30/2020 CSharp · VB
- Remove unnecessary using directives (IDE0005) IDE0005 12/13/2023 CSharp · VB
- 'var' preferences (IDE0007 and IDE0008) IDE0007 09/30/2020 CSharp
- Add missing cases to switch statement (IDE0010) IDE0010 09/30/2020 CSharp · VB
- Add braces (IDE0011) IDE0011 09/30/2020 CSharp
- Use throw expression (IDE0016) IDE0016 09/30/2020 CSharp
- Use object initializers (IDE0017) IDE0017 09/30/2020 CSharp · VB
- Inline variable declaration (IDE0018) IDE0018 09/30/2020 CSharp
- Use pattern matching to avoid 'as' followed by a 'null' check (IDE0019) IDE0019 09/30/2020 CSharp
- Use pattern matching to avoid 'is' check followed by a cast (IDE0020 and IDE0038) IDE0020 09/30/2020 CSharp
- Use expression body for constructors (IDE0021) IDE0021 09/30/2020 CSharp
- Use expression body for methods (IDE0022) IDE0022 09/30/2020 CSharp
- Use expression body for operators (IDE0023 and IDE0024) IDE0023 09/30/2020 CSharp
- Use expression body for properties (IDE0025) IDE0025 09/30/2020 CSharp
- Use expression body for indexers (IDE0026) IDE0026 09/30/2020 CSharp
- Use expression body for accessors (IDE0027) IDE0027 09/30/2020 CSharp
- Use collection initializers or expressions (IDE0028) IDE0028 04/11/2025 CSharp · VB
- Null check can be simplified (IDE0029, IDE0030, and IDE0270) IDE0029 07/25/2023 CSharp · VB
- Use null propagation (IDE0031) IDE0031 09/30/2020 CSharp · VB
- Use auto-implemented property (IDE0032) IDE0032 09/30/2020 CSharp · VB
- Use explicitly provided tuple name (IDE0033) IDE0033 09/30/2020 CSharp · VB
- Simplify 'default' expression (IDE0034) IDE0034 09/30/2020 CSharp
- Remove unreachable code (IDE0035) IDE0035 09/30/2020 CSharp · VB
- Order modifiers (IDE0036) IDE0036 09/30/2020 CSharp · VB
- Use inferred member names (IDE0037) IDE0037 09/30/2020 CSharp · VB
- Use local function instead of lambda (IDE0039) IDE0039 09/30/2020 CSharp
- Add accessibility modifiers (IDE0040) IDE0040 09/30/2020 CSharp · VB
- Use 'is null' check (IDE0041) IDE0041 02/13/2023 CSharp · VB
- Deconstruct variable declaration (IDE0042) IDE0042 09/30/2020 CSharp
- Invalid format string (IDE0043) IDE0043 07/07/2026 CSharp · VB
- Add readonly modifier (IDE0044) IDE0044 09/30/2020 CSharp · VB
- Use conditional expression for assignment (IDE0045) IDE0045 09/30/2020 CSharp · VB
- Use conditional expression for return (IDE0046) IDE0046 09/30/2020 CSharp · VB
- Parentheses preferences (IDE0047 and IDE0048) IDE0047 09/30/2020 CSharp · VB
- Use language keywords instead of framework type names for type references (IDE0049) IDE0049 09/30/2020 CSharp · VB
- Convert anonymous type to tuple (IDE0050) IDE0050 09/30/2020 CSharp · VB
- Remove unused private member (IDE0051) IDE0051 09/30/2020 CSharp · VB
- Remove unread private member (IDE0052) IDE0052 09/30/2020 CSharp · VB
- Use expression body for lambdas (IDE0053) IDE0053 09/30/2020 CSharp
- Use compound assignment (IDE0054 and IDE0074) IDE0054 09/30/2020 CSharp · VB
- Formatting rule (IDE0055) IDE0055 06/13/2022 CSharp · VB
- Use index operator (IDE0056) IDE0056 09/30/2020 CSharp
- Use range operator (IDE0057) IDE0057 09/30/2020 CSharp
- Remove unnecessary expression value (IDE0058) IDE0058 09/30/2020 CSharp · VB
- Remove unnecessary value assignment (IDE0059) IDE0059 01/05/2026
- Remove unused parameter (IDE0060) IDE0060 09/30/2020 CSharp · VB
- Use expression body for local functions (IDE0061) IDE0061 09/30/2020 CSharp
- Make local function static (IDE0062) IDE0062 09/30/2020 CSharp
- Use simple 'using' statement (IDE0063) IDE0063 03/18/2022 CSharp
- Make struct fields writable (IDE0064) IDE0064 09/30/2020 CSharp
- 'using' directive placement (IDE0065) IDE0065 09/30/2020 CSharp
- Use switch expression (IDE0066) IDE0066 09/30/2020 CSharp
- Use 'System.HashCode.Combine' (IDE0070) IDE0070 04/10/2026 CSharp · VB
- Simplify interpolation (IDE0071) IDE0071 09/30/2020 CSharp · VB
- Add missing cases to switch expression (IDE0072) IDE0072 09/30/2020 CSharp
- Require file header (IDE0073) IDE0073 09/30/2020 CSharp · VB
- Simplify conditional expression (IDE0075) IDE0075 09/30/2020 CSharp · VB
- Remove invalid global 'SuppressMessageAttribute' (IDE0076) IDE0076 09/30/2020 CSharp · VB
- Avoid legacy format target in global 'SuppressMessageAttribute' (IDE0077) IDE0077 07/27/2021 CSharp
- Use pattern matching (IDE0078 and IDE0260) IDE0078 09/30/2020 CSharp
- Remove unnecessary suppression (IDE0079) IDE0079 12/27/2024 CSharp · VB
- Remove unnecessary suppression operator (IDE0080) IDE0080 09/30/2020 CSharp
- Remove `ByVal` (IDE0081) IDE0081 09/30/2020 VB
- Convert `typeof` to `nameof` (IDE0082) IDE0082 09/30/2020 CSharp · VB
- Use pattern matching (`not` operator) (IDE0083) IDE0083 09/30/2020 CSharp
- Use pattern matching (`IsNot` operator) (IDE0084) IDE0084 09/30/2020 VB
- Simplify `new` expression (IDE0090) IDE0090 09/30/2020 CSharp
- Remove unnecessary equality operator (IDE0100) IDE0100 09/30/2020 CSharp · VB
- Remove unnecessary discard (IDE0110) IDE0110 11/02/2020 CSharp
- Simplify LINQ expression (IDE0120) IDE0120 07/19/2023 CSharp
- Simplify LINQ type check and cast (IDE0121) IDE0121 03/25/2025 CSharp
- Namespace does not match folder structure (IDE0130) IDE0130 12/05/2022 CSharp · VB
- Simplify object creation (IDE0140) IDE0140 04/17/2021
- Prefer 'null' check over type check (IDE0150) IDE0150 06/29/2022
- Namespace declaration preferences (IDE0160 and IDE0161) IDE0160 06/28/2022 CSharp
- Simplify property pattern (IDE0170) IDE0170 06/29/2022
- Use tuple to swap values (IDE0180) IDE0180 06/29/2022
- Remove unnecessary lambda expression (IDE0200) IDE0200 07/19/2023 CSharp
- Convert to top-level statements (IDE0210) IDE0210 07/20/2023 CSharp
- Convert to 'Program.Main' style program (IDE0211) IDE0211 07/20/2023 CSharp
- Add explicit cast in foreach loop (IDE0220) IDE0220 07/20/2023 CSharp
- Add explicit cast (IDE0221) IDE0221 04/10/2026 CSharp
- Use UTF-8 string literal (IDE0230) IDE0230 07/20/2023 CSharp
- Nullable directive is redundant (IDE0240) IDE0240 07/24/2023 CSharp
- Nullable directive is unnecessary (IDE0241) IDE0241 07/24/2023 CSharp
- Struct can be made 'readonly' (IDE0250) IDE0250 07/24/2023 CSharp
- Member can be made 'readonly' (IDE0251) IDE0251 07/24/2023 CSharp
- Use 'nameof' (IDE0280) IDE0280 07/26/2023 CSharp
- Use primary constructor (IDE0290) IDE0290 11/10/2023 CSharp
- Use collection expression for array (IDE0300) IDE0300 01/18/2024 CSharp
- Use collection expression for empty (IDE0301) IDE0301 12/12/2023 CSharp
- Use collection expression for stackalloc (IDE0302) IDE0302 12/12/2023 CSharp
- Use collection expression for `Create()` (IDE0303) IDE0303 12/12/2023 CSharp
- Use collection expression for builder (IDE0304) IDE0304 12/12/2023 CSharp
- Use collection expression for fluent (IDE0305) IDE0305 12/12/2023 CSharp
- Use collection expression for new (IDE0306) IDE0306 03/25/2025 CSharp
- Make anonymous function static (IDE0320) IDE0320 11/08/2024 CSharp
- Prefer 'System.Threading.Lock' (IDE0330) IDE0330 11/08/2024 CSharp
- Use unbound generic type (IDE0340) IDE0340 03/25/2025 CSharp
- Use implicitly typed lambda (IDE0350) IDE0350 03/25/2025 CSharp
- Simplify property accessor (IDE0360) IDE0360 11/08/2025 CSharp
- Remove unnecessary suppression (IDE0370) IDE0370 11/08/2025 CSharp
- Remove unnecessary `unsafe` modifier (IDE0380) IDE0380 11/08/2025 CSharp
- Make method synchronous (IDE0390 and IDE0391) IDE0390, IDE0391 07/07/2026 CSharp
- Use labeled jump statement (IDE0410) IDE0410 07/09/2026 CSharp
- Use conditional delegate call (IDE1005) IDE1005 09/30/2020 CSharp
- The name does not exist in the current context (IDE1007) IDE1007 07/07/2026 CSharp
- Avoid multiple blank lines (IDE2000) IDE2000 08/19/2025 CSharp
- Embedded statements must be on their own line (IDE2001) IDE2001 08/19/2025 CSharp · VB
- Consecutive braces must not have blank line between them (IDE2002) IDE2002 08/19/2025 CSharp
- Blank line required between block and subsequent statement (IDE2003) IDE2003 08/19/2025 CSharp
- Blank line not allowed after constructor initializer colon (IDE2004) IDE2004 08/19/2025 CSharp
- Blank line not allowed after conditional expression token (IDE2005) IDE2005 08/19/2025 CSharp
- Blank line not allowed after arrow expression clause token (IDE2006) IDE2006 08/19/2025 CSharp
- Implement with Copilot (IDE3000) IDE3000 05/20/2025 CSharp
- Code-style rules 07/09/2026
- Language and unnecessary rules 07/09/2026
- Miscellaneous rules 02/06/2021
- Code-style naming rules 09/25/2020 CSharp · VB
- How to suppress code analysis warnings 06/09/2022