Input: [Name] BetweenShowDelay [Description]

Output: Gets or sets the maximum time between the display of two tooltips where the second tooltip appears without a delay.


Input: [Name] HasDropShadow [Description]

Output: Gets or sets whether the tooltip displays a drop shadow effect.


Input: [Name] HorizontalOffset [Description]

Output: Gets or sets the offset from the left of the area that is specified for the tooltip by the PlacementRectangle and PlacementTarget properties.


Input: [Name] InitialShowDelay [Description]

Output: Gets or sets the length of time before a tooltip opens.


Input: [Name] IsEnabled [Description]

Output: Gets or sets whether a tooltip appears.


Input: [Name] IsOpen [Description]

Output: Gets whether a tooltip is currently visible.


Input: [Name] Placement [Description]

Output: Gets or sets the orientation of the tooltip when it opens, and specifies how the tooltip behaves when it overlaps screen boundaries.


Input: [Name] PlacementRectangle [Description]

Output: Gets or sets the rectangular area relative to which the tooltip is positioned.


Input: [Name] PlacementTarget [Description]

Output: Gets or sets the object relative to which the tooltip is positioned.


Input: [Name] ShowDuration [Description]

Output: Gets or sets the amount of time that a tooltip remains visible.


Input: [Name] ShowOnDisabled [Description]

Output: Gets or sets whether a tooltip appears for an object that is not enabled.


Input: [Name] ToolTip [Description]

Output: Gets or sets the content of a tooltip.


Input: [Name] VerticalOffset [Description]

Output: Gets or sets the distance from the top of the area that is specified for the tooltip by the PlacementRectangle and PlacementTarget properties.


Input: [Description] Gets or sets a custom StringCollection to use when the AutoCompleteSource property is set to CustomSource. [Member]

Output: AutoCompleteCustomSource property

New Additions to Existing Features in Windows Forms


Input: [Description] Gets or sets an option that controls how automatic completion works for the ComboBox. [Member]

Output: AutoCompleteMode property

New Additions to Existing Features in Windows Forms


Input: [Description] Gets or sets a value specifying the source of complete strings used for automatic completion. [Member]

Output: AutoCompleteSource property

New Additions to Existing Features in Windows Forms


Input: [Description] Gets or sets the background image layout as defined in the ImageLayout enumeration. [Member]

Output: BackgroundImageLayout property

New Additions to Existing Features in Windows Forms


Input: [Description] Maintains performance when items are added to the ComboBox one at a time. [Member]

Output: BeginUpdate method

New Additions to Existing Features in Windows Forms


Input: [Description] Occurs when the drop-down portion of a ComboBox is shown. [Member]

Output: DropDown event

New Additions to Existing Features in Windows Forms


Input: [Description] Occurs when the drop-down portion of the ComboBox is no longer visible. [Member]

Output: DropDownClosed event

New Additions to Existing Features in Windows Forms


Input: [Description] Resumes painting the ComboBox control after painting is suspended by the BeginUpdate method. [Member]

Output: EndUpdate method

New Additions to Existing Features in Windows Forms


Input: [Description] Gets or sets the flat style appearance of the button control. [Member]

Output: FlatStyle property

New Additions to Existing Features in Windows Forms


Input: [Description] Raises the DropDownClosed event. [Member]

Output: OnDropDownClosed method

New Additions to Existing Features in Windows Forms


Input: [Description] Raises the MouseEnter event. [Member]

Output: OnMouseEnter method

New Additions to Existing Features in Windows Forms


Input: [Description] Raises the MouseLeave event. [Member]

Output: OnMouseLeave method

New Additions to Existing Features in Windows Forms


Input: [Description] Raises the TextUpdate event. [Member]

Output: OnTextUpdate method

New Additions to Existing Features in Windows Forms


Input: [Description] Occurs when the control has formatted the text, but before the text is displayed. [Member]

Output: TextUpdate event

New Additions to Existing Features in Windows Forms


Input: [Member name] AnotherRebootPending [Description]

Output: The job could not start because another job is restarting. The value of this member is -2147217387.


Input: [Member name] AssessmentPreparation [Description]

Output: There was an error when preparing to run an assessment. The value of this member is -2147217383.


Input: [Member name] AssessmentsFailed [Description]

Output: The job ended with one or more failed assessments. The value of this member is -2147217388.


Input: [Member name] Canceled [Description]

Output: The job was cancelled. The value of this member is -2147217389.


Input: [Member name] Changed [Description]

Output: A job was automatically run by the solution after a reboot. However, the job was modified or not the same. The value of this member is -2147217375.


Input: [Member name] None [Description]

Output: The job ran successfully. The value of this member is 0.


Input: [Member name] NoRebootPending [Description]

Output: There is no job currently awaiting a reboot. The value of this member is -2147217386.


Input: [Member name] PostExecution [Description]

Output: There was an error performing the job after the execution action. The value of this member is -2147217382.


Input: [Member name] Preparation [Description]

Output: The job could not be run because one or more preparation steps failed. Check the logs for more details. The value of this member is -2147217385.


Input: [Member name] RestartBadData [Description]

Output: The job restart state data could not be saved while running. The value of this member is -2147217373.


Input: [Member name] RestartFailed [Description]

Output: The job restart state data was corrupt once the system restarted. The value of this member is -2147217374.


Input: [Member name] RestartPending [Description]

Output: The job restart is pending. The value of this member is -2147217372.


Input: [Member name] ResultsFailed [Description]

Output: There was an error generating or finalizing the results file. The value of this member is -2147217384.


Input: [Member name] SolutionRestart [Description]

Output: There was an error while trying to change solutions. The value of this member is -2147217371.


Input: [Member name] WaitTimeout [Description]

Output: The job could not be run because the timeout elapsed before the currently running job completed. The value of this member is -2147217381.


Input: [UI Automation Property] AutomationIdProperty [Value] See notes. [Notes]

Output: The value of this property needs to be unique across all controls in an application.

UI Automation Support for the List Control Type


Input: [UI Automation Property] BoundingRectangleProperty [Value] See notes. [Notes]

Output: The outermost rectangle that contains the whole control.

UI Automation Support for the List Control Type


Input: [UI Automation Property] ClickablePointProperty [Value] See notes. [Notes]

Output: If the list control has a clickable point (a point that can be clicked to cause the list to take focus), then that point must be exposed through this property. If the value of the IsOffScreen property is true, then the NoClickablePointExceptionwill be raised.

UI Automation Support for the List Control Type


Input: [UI Automation Property] IsKeyboardFocusableProperty [Value] See notes. [Notes]

Output: If the control can receive keyboard focus, it must support this property.

UI Automation Support for the List Control Type


Input: [UI Automation Property] NameProperty [Value] See notes. [Notes]

Output: The value of a list control's Name property should convey the category of options that the user is being asked to select from. This property typically gets its name from a static text label. If there is not a static text label the application developer must expose a value for the Name property. The only time this property is not required for list controls is if the control is used within the subtree of another control.

UI Automation Support for the List Control Type


Input: [UI Automation Property] LabeledByProperty [Value] See notes. [Notes]

Output: If there is a static text label then this property must expose a reference to that control.

UI Automation Support for the List Control Type


Input: [UI Automation Property] ControlTypeProperty [Value] List [Notes]

Output: This value is the same for all UI frameworks.

UI Automation Support for the List Control Type


Input: [UI Automation Property] LocalizedControlTypeProperty [Value] "list" [Notes]

Output: Localized string corresponding to the List control type.

UI Automation Support for the List Control Type


Input: [UI Automation Property] IsContentElementProperty [Value] True [Notes]

Output: The list control is always included in the content view of the UI Automation tree.

UI Automation Support for the List Control Type


Input: [UI Automation Property] IsControlElementProperty [Value] True [Notes]

Output: The list control is always included in the control view of the UI Automation tree.

UI Automation Support for the List Control Type


Input: [UI Automation Property] IsKeyboardFocusableProperty [Value] True [Notes]

Output: If the container can accept keyboard input then this property value should be true.

UI Automation Support for the List Control Type


Input: [UI Automation Property] HelpTextProperty [Value] See notes. [Notes]

Output: The Help text for list controls should explain why the user is being asked to make a choice from a list of options. For example, "Selection an item from this list will set the display resolution for your monitor."

UI Automation Support for the List Control Type


Input: [Description] Introduces how to write a custom data processing extension for Reporting Services. [Topic]

Output: Introducing Data Processing Extensions

Implementing a Data Processing Extension


Input: [Description] Describes the requirements for implementing a custom data processing extension. [Topic]

Output: Getting Started with a Processing Extension Implementation

Implementing a Data Processing Extension


Input: [Description] Describes the attributes of a connection and how to implement your own Connection class for your data processing extension. [Topic]

Output: Implementing a Connection Class for a Data Processing Extension

Implementing a Data Processing Extension


Input: [Description] Describes the attributes of a command, and how to implement your own Command class for your data processing extension. [Topic]

Output: Implementing a Command Class for a Data Processing Extension

Implementing a Data Processing Extension


Input: [Description] Describes the attributes of a data reader and how to implement your own DataReader class for your data processing extension. [Topic]

Output: Implementing a DataReader Class for a Data Processing Extension

Implementing a Data Processing Extension


Input: [Description] Describes how to expose your custom DataSet objects to the report server for consumption. [Topic]

Output: Using an External Dataset with Reporting Services

Implementing a Data Processing Extension


Input: [Description] Describes how to deploy your data processing extension. [Topic]

Output: Deploying a Data Processing Extension

Implementing a Data Processing Extension


Input: [Description] Describes how to debug code in your data processing extensions. [Topic]

Output: Debugging Data Processing Extension Code

Implementing a Data Processing Extension


Input: [Description] Describes how to remove a data processing extension from a report server or Report Designer. [Topic]

Output: Removing a Data Processing Extension

Implementing a Data Processing Extension


Input: [Member name] AllCells [Description]

Output: The column widths adjust to fit the contents of all cells in the columns, including header cells.


Input: [Member name] AllCellsExceptHeader [Description]

Output: The column widths adjust to fit the contents of all cells in the columns, excluding header cells.


Input: [Member name] DisplayedCells [Description]

Output: The column widths adjust to fit the contents of all cells in the columns that are in rows currently displayed onscreen, including header cells.


Input: [Member name] DisplayedCellsExceptHeader [Description]

Output: The column widths adjust to fit the contents of all cells in the columns that are in rows currently displayed onscreen, excluding header cells.


Input: [Member name] None [Description]

Output: The column widths do not automatically adjust.


Input: [Member name] ColumnHeader [Description]

Output: The column widths adjust to fit the contents of the column header cells.


Input: [Member name] Fill [Description]

Output: The column widths adjust so that the widths of all columns exactly fill the display area of the control, requiring horizontal scrolling only to keep column widths above the DataGridViewColumn.MinimumWidth property values. Relative column widths are determined by the relative DataGridViewColumn.FillWeight property values.


Input: [Meaning] Disables automatic hyphenation. [Value]

Output: PFE_DONOTHYPHEN


Input: [Meaning] No page break within the paragraph. [Value]

Output: PFE_KEEP


Input: [Meaning] No page break between this paragraph and the next. [Value]

Output: PFE_KEEPNEXT


Input: [Meaning] Disables line numbering (not implemented). [Value]

Output: PFE_NOLINENUMBER


Input: [Meaning] Disables widow and orphan control for the selected paragraph. [Value]

Output: PFE_NOWIDOWCONTROL


Input: [Meaning] Inserts a page break before the selected paragraph. [Value]

Output: PFE_PAGEBREAKBEFORE


Input: [Meaning] Displays text using right-to-left reading order (in Rich Edit 2.1 and later). [Value]

Output: PFE_RTLPARA


Input: [Meaning] Displays paragraphs side by side (not implemented). [Value]

Output: PFE_SIDEBYSIDE


Input: [Meaning] The paragraph is a table row. [Value]

Output: PFE_TABLE


Input: [Meaning] The paragraph is a start delimiter (U+FFF9 U+000D) or end delimiter (U+FFFB U+000D) of a row in a table. [Value]

Output: PFE_TABLEROWDELIMITER


Input: [Name] ClassifierFunction [Description]

Output: Gets or sets a classifier user-defined function for implementing classification rules.


Input: [Name] Enabled [Description]

Output: Gets or sets a value that indicates whether the resource governor is enabled.


Input: [Name] MaxOutstandingIOPerVolume [Description]

Output: Gets or sets the maximum outstanding Input/Output of resource per volume.


Input: [Name] Parent [Description]

Output: Returns the parent object, in this case a server.


Input: [Name] Properties [Description]

Output: Gets a collection of Property objects that represent the object properties.(Inherited from SqlSmoObject.)


Input: [Name] ReconfigurePending [Description]

Output: Indicates whether changes to a group or pool were made but have not been applied to the in-memory configuration.


Input: [Name] ResourcePools [Description]

Output: Gets the Resource Pool Collection.


Input: [Name] State [Description]

Output: Gets the state of the referenced object.(Inherited from SmoObjectBase.)


Input: [Name] Urn [Description]

Output: Gets the Uniform Resource Name (URN) address value that uniquely identifies the object.(Inherited from SqlSmoObject.)


Input: [Name] UserData [Description]

Output: Gets or sets user-defined data associated with the referenced object.(Inherited from SmoObjectBase.)


Input: [To do this...] Create a text file.

Output: How to: Write Text to a File


Input: [To do this...] Write to a text file.

Output: How to: Write Text to a File


Input: [To do this...] Read from a text file.

Output: How to: Read Text from a File


Input: [To do this...] Append text to a file.

Output: How to: Open and Append to a Log File File.AppendText FileInfo.AppendText


Input: [To do this...] Get the size of a file.

Output: FileInfo.Length


Input: [To do this...] Get the attributes of a file.

Output: File.GetAttributes


Input: [To do this...] Set the attributes of a file.

Output: File.SetAttributes


Input: [To do this...] Determine if a file exists.

Output: File.Exists


Input: [To do this...] Read from a binary file.

Output: How to: Read and Write to a Newly Created Data File


Input: [To do this...] Write to a binary file.

Output: How to: Read and Write to a Newly Created Data File


Input: [Name] MaxValue [Description]

Output: Represents the maximum valid date value for a SqlDateTime structure.


Input: [Name] MinValue [Description]

Output: Represents the minimum valid date value for a SqlDateTime structure.


Input: [Name] Null [Description]

Output: Represents a null value that can be assigned to the Value property of an instance of the SqlDateTime structure.


Input: [Name] SQLTicksPerHour [Description]

Output: A constant whose value is the number of ticks equivalent to one hour.


Input: [Name] SQLTicksPerMinute [Description]

Output: A constant whose value is the number of ticks equivalent to one minute.


Input: [Name] SQLTicksPerSecond [Description]

Output: A constant whose value is the number of ticks equivalent to one second.


Input: [CheckId] CA1000 [Warning] CA1000: Do not declare static members on generic types [Description]

Output: When a static member of a generic type is called, the type argument must be specified for the type. When a generic instance member that does not support inference is called, the type argument must be specified for the member. In these two cases, the syntax for specifying the type argument is different and easily confused.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1001 [Warning] CA1001: Types that own disposable fields should be disposable [Description]

Output: A class declares and implements an instance field that is a System.IDisposable type, and the class does not implement IDisposable. A class that declares an IDisposable field indirectly owns an unmanaged resource and should implement the IDisposable interface.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1002 [Warning] CA1002: Do not expose generic lists [Description]

Output: System.Collections.Generic.List<(Of <(T>)>) is a generic collection that is designed for performance, not inheritance. Therefore, List does not contain any virtual members. The generic collections that are designed for inheritance should be exposed instead.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1003 [Warning] CA1003: Use generic event handler instances [Description]

Output: A type contains a delegate that returns void, whose signature contains two parameters (the first an object and the second a type that is assignable to EventArgs), and the containing assembly targets Microsoft .NET Framework 2.0.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1004 [Warning] CA1004: Generic methods should provide type parameter [Description]

Output: Inference is how the type argument of a generic method is determined by the type of argument that is passed to the method, instead of by the explicit specification of the type argument. To enable inference, the parameter signature of a generic method must include a parameter that is of the same type as the type parameter for the method. In this case, the type argument does not have to be specified. When using inference for all type parameters, the syntax for calling generic and non-generic instance methods is identical; this simplifies the usability of generic methods.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1005 [Warning] CA1005: Avoid excessive parameters on generic types [Description]

Output: The more type parameters a generic type contains, the more difficult it is to know and remember what each type parameter represents. It is usually obvious with one type parameter, as in List, and in certain cases that have two type parameters, as in Dictionary. However, if more than two type parameters exist, the difficulty becomes too great for most users.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1006 [Warning] CA1006: Do not nest generic types in member signatures [Description]

Output: A nested type argument is a type argument that is also a generic type. To call a member whose signature contains a nested type argument, the user must instantiate one generic type and pass this type to the constructor of a second generic type. The required procedure and syntax are complex and should be avoided.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1007 [Warning] CA1007: Use generics where appropriate [Description]

Output: An externally visible method contains a reference parameter of type System.Object. Use of a generic method enables all types, subject to constraints, to be passed to the method without first casting the type to the reference parameter type.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1008 [Warning] CA1008: Enums should have zero value [Description]

Output: The default value of an uninitialized enumeration, just as other value types, is zero. A nonflags-attributed enumeration should define a member by using the value of zero so that the default value is a valid value of the enumeration. If an enumeration that has the FlagsAttribute attribute applied defines a zero-valued member, its name should be "None" to indicate that no values have been set in the enumeration.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1009 [Warning] CA1009: Declare event handlers correctly [Description]

Output: Event handler methods take two parameters. The first is of type System.Object and is named "sender". This is the object that raised the event. The second parameter is of type System.EventArgs and is named "e". This is the data that is associated with the event. Event handler methods should not return a value; in the C# programming language, this is indicated by the return type void.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1010 [Warning] CA1010: Collections should implement generic interface [Description]

Output: To broaden the usability of a collection, implement one of the generic collection interfaces. Then the collection can be used to populate generic collection types.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1011 [Warning] CA1011: Consider passing base types as parameters [Description]

Output: When a base type is specified as a parameter in a method declaration, any type that is derived from the base type can be passed as the corresponding argument to the method. If the additional functionality that is provided by the derived parameter type is not required, use of the base type enables wider use of the method.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1012 [Warning] CA1012: Abstract types should not have constructors [Description]

Output: Constructors on abstract types can be called only by derived types. Because public constructors create instances of a type, and you cannot create instances of an abstract type, an abstract type that has a public constructor is incorrectly designed.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1013 [Warning] CA1013: Overload operator equals on overloading add and subtract [Description]

Output: A public or protected type implements the addition or subtraction operators without implementing the equality operator.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1014 [Warning] CA1014: Mark assemblies with CLSCompliantAttribute [Description]

Output: The Common Language Specification (CLS) defines naming restrictions, data types, and rules to which assemblies must conform if they will be used across programming languages. Good design dictates that all assemblies explicitly indicate CLS compliance by using CLSCompliantAttribute . If this attribute is not present on an assembly, the assembly is not compliant.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1016 [Warning] CA1016: Mark assemblies with AssemblyVersionAttribute [Description]

Output: The .NET Framework uses the version number to uniquely identify an assembly, and to bind to types in strongly named assemblies. The version number is used together with version and publisher policy. By default, applications run only with the assembly version with which they were built.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1017 [Warning] CA1017: Mark assemblies with ComVisibleAttribute [Description]

Output: ComVisibleAttribute determines how COM clients access managed code. Good design dictates that assemblies explicitly indicate COM visibility. COM visibility can be set for the whole assembly and then overridden for individual types and type members. If this attribute is not present, the contents of the assembly are visible to COM clients.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1018 [Warning] CA1018: Mark attributes with AttributeUsageAttribute [Description]

Output: When you define a custom attribute, mark it by using AttributeUsageAttribute to indicate where in the source code the custom attribute can be applied. The meaning and intended usage of an attribute will determine its valid locations in code.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1019 [Warning] CA1019: Define accessors for attribute arguments [Description]

Output: Attributes can define mandatory arguments that must be specified when you apply the attribute to a target. These are also known as positional arguments because they are supplied to attribute constructors as positional parameters. For every mandatory argument, the attribute should also provide a corresponding read-only property so that the value of the argument can be retrieved at execution time. Attributes can also define optional arguments, which are also known as named arguments. These arguments are supplied to attribute constructors by name and should have a corresponding read/write property.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1020 [Warning] CA1020: Avoid namespaces with few types [Description]

Output: Make sure that each of your namespaces has a logical organization, and that a valid reason exists for putting types in a sparsely populated namespace.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1021 [Warning] CA1021: Avoid out parameters [Description]

Output: Passing types by reference (using out or ref) requires experience with pointers, understanding how value types and reference types differ, and handling methods with multiple return values. Also, the difference between out and ref parameters is not widely understood.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1023 [Warning] CA1023: Indexers should not be multidimensional [Description]

Output: Indexers (that is, indexed properties) should use a single index. Multidimensional indexers can significantly reduce the usability of the library.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1024 [Warning] CA1024: Use properties where appropriate [Description]

Output: A public or protected method has a name that starts with "Get", takes no parameters, and returns a value that is not an array. The method might be a good candidate to become a property.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1025 [Warning] CA1025: Replace repetitive arguments with params array [Description]

Output: Use a parameter array instead of repeated arguments when the exact number of arguments is unknown and when the variable arguments are the same type or can be passed as the same type.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1026 [Warning] CA1026: Default parameters should not be used [Description]

Output: Methods that use default parameters are allowed under the CLS; however, the CLS lets compilers ignore the values that are assigned to these parameters. To maintain the behavior that you want across programming languages, methods that use default parameters should be replaced by method overloads that provide the default parameters.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1027 [Warning] CA1027: Mark enums with FlagsAttribute [Description]

Output: An enumeration is a value type that defines a set of related named constants. Apply FlagsAttribute to an enumeration when its named constants can be meaningfully combined.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1028 [Warning] CA1028: Enum storage should be Int32 [Description]

Output: An enumeration is a value type that defines a set of related named constants. By default, the System.Int32 data type is used to store the constant value. Although you can change this underlying type, it is not required or recommended for most scenarios.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1030 [Warning] CA1030: Use events where appropriate [Description]

Output: This rule detects methods that have names that ordinarily would be used for events. If a method is called in response to a clearly defined state change, the method should be invoked by an event handler. Objects that call the method should raise events instead of calling the method directly.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1031 [Warning] CA1031: Do not catch general exception types [Description]

Output: General exceptions should not be caught. Catch a more specific exception, or rethrow the general exception as the last statement in the catch block.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1032 [Warning] CA1032: Implement standard exception constructors [Description]

Output: Failure to provide the full set of constructors can make it difficult to correctly handle exceptions.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1033 [Warning] CA1033: Interface methods should be callable by child types [Description]

Output: An unsealed externally visible type provides an explicit method implementation of a public interface and does not provide an alternative externally visible method that has the same name.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1034 [Warning] CA1034: Nested types should not be visible [Description]

Output: A nested type is a type that is declared in the scope of another type. Nested types are useful to encapsulate private implementation details of the containing type. Used for this purpose, nested types should not be externally visible.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1035 [Warning] CA1035: ICollection implementations have strongly typed members [Description]

Output: This rule requires ICollection implementations to provide strongly typed members so that users are not required to cast arguments to the Object type when they use the functionality that is provided by the interface. This rule assumes that the type that implements ICollection does so to manage a collection of instances of a type that is stronger than Object.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1036 [Warning] CA1036: Override methods on comparable types [Description]

Output: A public or protected type implements the System.IComparable interface. It does not override Object.Equals nor does it overload the language-specific operator for equality, inequality, less than, or greater than.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1038 [Warning] CA1038: Enumerators should be strongly typed [Description]

Output: This rule requires IEnumerator implementations to also provide a strongly typed version of the Current property so that users are not required to cast the return value to the strong type when they use the functionality that is provided by the interface.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1039 [Warning] CA1039: Lists are strongly typed [Description]

Output: This rule requires IList implementations to provide strongly typed members so that users are not required to cast arguments to the System.Object type when they use the functionality that is provided by the interface.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1040 [Warning] CA1040: Avoid empty interfaces [Description]

Output: Interfaces define members that provide a behavior or usage contract. The functionality that is described by the interface can be adopted by any type, regardless of where the type appears in the inheritance hierarchy. A type implements an interface by providing implementations for the members of the interface. An empty interface does not define any members; therefore, it does not define a contract that can be implemented.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1041 [Warning] CA1041: Provide ObsoleteAttribute message [Description]

Output: A type or member is marked by using a System.ObsoleteAttribute attribute that does not have its ObsoleteAttribute.Message property specified. When a type or member that is marked by using ObsoleteAttribute is compiled, the Message property of the attribute is displayed. This gives the user information about the obsolete type or member.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1043 [Warning] CA1043: Use integral or string argument for indexers [Description]

Output: Indexers (that is, indexed properties) should use integral or string types for the index. These types are typically used for indexing data structures and they increase the usability of the library. Use of the Object type should be restricted to those cases where the specific integral or string type cannot be specified at design time.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1044 [Warning] CA1044: Properties should not be write only [Description]

Output: Although it is acceptable and often necessary to have a read-only property, the design guidelines prohibit the use of write-only properties. This is because letting a user set a value, and then preventing the user from viewing that value, does not provide any security. Also, without read access, the state of shared objects cannot be viewed, which limits their usefulness.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1045 [Warning] CA1045: Do not pass types by reference [Description]

Output: Passing types by reference (using out or ref) requires experience with pointers, understanding how value types and reference types differ, and handling methods that have multiple return values. Library architects who design for a general audience should not expect users to master working with out or ref parameters.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1046 [Warning] CA1046: Do not overload operator equals on reference types [Description]

Output: For reference types, the default implementation of the equality operator is almost always correct. By default, two references are equal only if they point to the same object.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1047 [Warning] CA1047: Do not declare protected members in sealed types [Description]

Output: Types declare protected members so that inheriting types can access or override the member. By definition, sealed types cannot be inherited, which means that protected methods on sealed types cannot be called.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1048 [Warning] CA1048: Do not declare virtual members in sealed types [Description]

Output: Types declare methods as virtual so that inheriting types can override the implementation of the virtual method. By definition, a sealed type cannot be inherited. This makes a virtual method on a sealed type meaningless.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1049 [Warning] CA1049: Types that own native resources should be disposable [Description]

Output: Types that allocate unmanaged resources should implement IDisposable to enable callers to release those resources on demand and to shorten the lifetimes of the objects that hold the resources.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1050 [Warning] CA1050: Declare types in namespaces [Description]

Output: Types are declared in namespaces to prevent name collisions and as a way to organize related types in an object hierarchy.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1051 [Warning] CA1051: Do not declare visible instance fields [Description]

Output: The primary use of a field should be as an implementation detail. Fields should be private or internal and should be exposed by using properties.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1052 [Warning] CA1052: Static holder types should be sealed [Description]

Output: A public or protected type contains only static members and is not declared by using the sealed (C# Reference) (NotInheritable) modifier. A type that is not meant to be inherited should be marked by using the sealed modifier to prevent its use as a base type.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1053 [Warning] CA1053: Static holder types should not have constructors [Description]

Output: A public or nested public type declares only static members and has a public or protected default constructor. The constructor is unnecessary because calling static members does not require an instance of the type. The string overload should call the uniform resource identifier (URI) overload by using the string argument for safety and security.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1054 [Warning] CA1054: URI parameters should not be strings [Description]

Output: If a method takes a string representation of a URI, a corresponding overload should be provided that takes an instance of the URI class, which provides these services in a safe and secure manner.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1055 [Warning] CA1055: URI return values should not be strings [Description]

Output: This rule assumes that the method returns a URI. A string representation of a URI is prone to parsing and encoding errors, and can lead to security vulnerabilities. The System.Uri class provides these services in a safe and secure manner.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1056 [Warning] CA1056: URI properties should not be strings [Description]

Output: This rule assumes that the property represents a Uniform Resource Identifier (URI). A string representation of a URI is prone to parsing and encoding errors, and can lead to security vulnerabilities. The System.Uri class provides these services in a safe and secure manner.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1057 [Warning] CA1057: String URI overloads call System.Uri overloads [Description]

Output: A type declares method overloads that differ only by the replacement of a string parameter with a System.Uri parameter. The overload that takes the string parameter does not call the overload that takes the URI parameter.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1058 [Warning] CA1058: Types should not extend certain base types [Description]

Output: An externally visible type extends certain base types. Use one of the alternatives.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1059 [Warning] CA1059: Members should not expose certain concrete types [Description]

Output: A concrete type is a type that has a complete implementation and therefore can be instantiated. To enable widespread use of the member, replace the concrete type by using the suggested interface.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1060 [Warning] CA1060: Move P/Invokes to NativeMethods class [Description]

Output: Platform Invocation methods, such as those that are marked by using the System.Runtime.InteropServices.DllImportAttribute attribute, or methods that are defined by using the Declare keyword in Visual Basic, access unmanaged code. These methods should be of the NativeMethods, SafeNativeMethods, or UnsafeNativeMethods class.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1061 [Warning] CA1061: Do not hide base class methods [Description]

Output: A method in a base type is hidden by an identically named method in a derived type, when the parameter signature of the derived method differs only by types that are more weakly derived than the corresponding types in the parameter signature of the base method.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1062 [Warning] CA1062: Validate arguments of public methods [Description]

Output: All reference arguments that are passed to externally visible methods should be checked against null.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1063 [Warning] CA1063: Implement IDisposable correctly [Description]

Output: All IDisposable types should implement the Dispose pattern correctly.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1064 [Warning] CA1064: Exceptions should be public [Description]

Output: An internal exception is visible only inside its own internal scope. After the exception falls outside the internal scope, only the base exception can be used to catch the exception. If the internal exception is inherited from T:System.Exception, T:System.SystemException, or T:System.ApplicationException, the external code will not have sufficient information to know what to do with the exception.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1065 [Warning] CA1065: Do not raise exceptions in unexpected locations [Description]

Output: A method that is not expected to throw exceptions throws an exception.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1300 [Warning] CA1300: Specify MessageBoxOptions [Description]

Output: To correctly display a message box for cultures that use a right-to-left reading order, the RightAlign and RtlReading members of the MessageBoxOptions enumeration must be passed to the Show method.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1301 [Warning] CA1301: Avoid duplicate accelerators [Description]

Output: An access key, also known as an accelerator, enables keyboard access to a control by using the ALT key. When multiple controls have duplicate access keys, the behavior of the access key is not well defined.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1302 [Warning] CA1302: Do not hardcode locale specific strings [Description]

Output: The System.Environment.SpecialFolder enumeration contains members that refer to special system folders. The locations of these folders can have different values on different operating systems; the user can change some of the locations; and the locations are localized. The Environment.GetFolderPath method returns the locations that are associated with the Environment.SpecialFolder enumeration, localized and appropriate for the currently running computer.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1303 [Warning] CA1303: Do not pass literals as localized parameters [Description]

Output: An externally visible method passes a string literal as a parameter to a constructor or method in the .NET Framework class library, and that string should be localizable.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1304 [Warning] CA1304: Specify CultureInfo [Description]

Output: A method or constructor calls a member that has an overload that accepts a System.Globalization.CultureInfo parameter, and the method or constructor does not call the overload that takes the CultureInfo parameter. When a CultureInfo or System.IFormatProvider object is not supplied, the default value that is supplied by the overloaded member might not have the effect that you want in all locales.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1305 [Warning] CA1305: Specify IFormatProvider [Description]

Output: A method or constructor calls one or more members that have overloads that accept a System.IFormatProvider parameter, and the method or constructor does not call the overload that takes the IFormatProvider parameter. When a System.Globalization.CultureInfo or IFormatProvider object is not supplied, the default value that is supplied by the overloaded member might not have the effect that you want in all locales.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1306 [Warning] CA1306: Set locale for data types [Description]

Output: The locale determines culture-specific presentation elements for data, such as formatting that is used for numeric values, currency symbols, and sort order. When you create a DataTable or DataSet, you should explicitly set the locale.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1307 [Warning] CA1307: Specify StringComparison [Description]

Output: A string comparison operation uses a method overload that does not set a StringComparison parameter.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1308 [Warning] CA1308: Normalize strings to uppercase [Description]

Output: Strings should be normalized to uppercase. A small group of characters cannot make a round trip when they are converted to lowercase.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1309 [Warning] CA1309: Use ordinal StringComparison [Description]

Output: A string comparison operation that is nonlinguistic does not set the StringComparison parameter to either Ordinal or OrdinalIgnoreCase. By explicitly setting the parameter to either StringComparison.Ordinal or StringComparison.OrdinalIgnoreCase, your code often gains speed, becomes more correct, and becomes more reliable.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1400 [Warning] CA1400: P/Invoke entry points should exist [Description]

Output: A public or protected method is marked by using the System.Runtime.InteropServices.DllImportAttribute attribute. Either the unmanaged library could not be located or the method could not be matched to a function in the library.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1401 [Warning] CA1401: P/Invokes should not be visible [Description]

Output: A public or protected method in a public type has the System.Runtime.InteropServices.DllImportAttribute attribute (also implemented by the Declare keyword in Visual Basic). Such methods should not be exposed.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1402 [Warning] CA1402: Avoid overloads in COM visible interfaces [Description]

Output: When overloaded methods are exposed to COM clients, only the first method overload retains its name. Subsequent overloads are uniquely renamed by appending to the name an underscore character (_) and an integer that corresponds to the order of declaration of the overload.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1403 [Warning] CA1403: Auto layout types should not be COM visible [Description]

Output: A COM-visible value type is marked by using the System.Runtime.InteropServices.StructLayoutAttribute attribute set to LayoutKind.Auto. The layout of these types can change between versions of the .NET Framework, which will break COM clients that expect a specific layout.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1404 [Warning] CA1404: Call GetLastError immediately after P/Invoke [Description]

Output: A call is made to the Marshal.GetLastWin32Error method or the equivalent Win32 GetLastError function, and the immediately previous call is not to an operating system invoke method.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1405 [Warning] CA1405: COM visible type base types should be COM visible [Description]

Output: A COM-visible type derives from a type that is not COM-visible.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1406 [Warning] CA1406: Avoid Int64 arguments for Visual Basic 6 clients [Description]

Output: Visual Basic 6 COM clients cannot access 64-bit integers.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1407 [Warning] CA1407: Avoid static members in COM visible types [Description]

Output: COM does not support static methods.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1408 [Warning] CA1408: Do not use AutoDual ClassInterfaceType [Description]

Output: Types that use a dual interface enable clients to bind to a specific interface layout. Any changes in a future version to the layout of the type or any base types will break COM clients that bind to the interface. By default, if the ClassInterfaceAttribute attribute is not specified, a dispatch-only interface is used.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1409 [Warning] CA1409: Com visible types should be creatable [Description]

Output: A reference type that is specifically marked as visible to COM contains a public parameterized constructor but does not contain a public default (parameterless) constructor. A type without a public default constructor is not creatable by COM clients.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1410 [Warning] CA1410: COM registration methods should be matched [Description]

Output: A type declares a method that is marked by using the System.Runtime.InteropServices.ComRegisterFunctionAttribute attribute but does not declare a method marked by using the System.Runtime.InteropServices.ComUnregisterFunctionAttribute attribute, or vice versa.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1411 [Warning] CA1411: COM registration methods should not be visible [Description]

Output: A method marked by using the System.Runtime.InteropServices.ComRegisterFunctionAttribute attribute or the System.Runtime.InteropServices.ComUnregisterFunctionAttribute attribute is externally visible.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1412 [Warning] CA1412: Mark ComSource Interfaces as IDispatch [Description]

Output: A type is marked by using the System.Runtime.InteropServices.ComSourceInterfacesAttribute attribute, and at least one of the specified interfaces is not marked by using the System.Runtime.InteropServices.InterfaceTypeAttribute attribute set to ComInterfaceType.InterfaceIsIDispatch.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1413 [Warning] CA1413: Avoid non-public fields in COM visible value types [Description]

Output: Nonpublic instance fields of COM-visible value types are visible to COM clients. Review the content of the fields for information that should not be exposed, or that will have unintended design or security effects.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1414 [Warning] CA1414: Mark boolean P/Invoke arguments with MarshalAs [Description]

Output: The Boolean data type has multiple representations in unmanaged code.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1415 [Warning] CA1415: Declare P/Invokes correctly [Description]

Output: This rule looks for operating system invoke method declarations that target Win32 functions that have a pointer to an OVERLAPPED structure parameter and the corresponding managed parameter is not a pointer to a System.Threading.NativeOverlapped structure.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1500 [Warning] CA1500: Variable names should not match field names [Description]

Output: An instance method declares a parameter or a local variable whose name matches an instance field of the declaring type, leading to errors.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1501 [Warning] CA1501: Avoid excessive inheritance [Description]

Output: A type is more than four levels deep in its inheritance hierarchy. Deeply nested type hierarchies can be difficult to follow, understand, and maintain.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1502 [Warning] CA1502: Avoid excessive complexity [Description]

Output: This rule measures the number of linearly independent paths through the method, which is determined by the number and complexity of conditional branches.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1504 [Warning] CA1504: Review misleading field names [Description]

Output: The name of an instance field starts with "s_", or the name of a static (Shared in Visual Basic) field starts with "m_".

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1505 [Warning] CA1505: Avoid unmaintainable code [Description]

Output: A type or method has a low maintainability index value. A low maintainability index indicates that a type or method is probably difficult to maintain and would be a good candidate for redesign.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1506 [Warning] CA1506: Avoid excessive class coupling [Description]

Output: This rule measures class coupling by counting the number of unique type references that a type or method contains.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1600 [Warning] CA1600: Do not use idle process priority [Description]

Output: Do not set process priority to Idle. Processes that have System.Diagnostics.ProcessPriorityClass.Idle will occupy the CPU when it would otherwise be idle, and will therefore block standby.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1601 [Warning] CA1601: Do not use timers that prevent power state changes [Description]

Output: Higher-frequency periodic activity will keep the CPU busy and interfere with power-saving idle timers that turn off the display and hard disks.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1700 [Warning] CA1700: Do not name enum values 'Reserved' [Description]

Output: This rule assumes that an enumeration member that has a name that contains "reserved" is not currently used but is a placeholder to be renamed or removed in a future version. Renaming or removing a member is a breaking change.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1701 [Warning] CA1701: Resource string compound words should be cased correctly [Description]

Output: Each word in the resource string is split into tokens based on the casing. Each contiguous two-token combination is checked by the Microsoft spelling checker library. If recognized, the word produces a violation of the rule.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1702 [Warning] CA1702: Compound words should be cased correctly [Description]

Output: The name of an identifier contains multiple words, and at least one of the words appears to be a compound word that is not cased correctly.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1703 [Warning] CA1703: Resource strings should be spelled correctly [Description]

Output: A resource string contains one or more words that are not recognized by the Microsoft spelling checker library.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1704 [Warning] CA1704: Identifiers should be spelled correctly [Description]

Output: The name of an externally visible identifier contains one or more words that are not recognized by the Microsoft spelling checker library.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1707 [Warning] CA1707: Identifiers should not contain underscores [Description]

Output: By convention, identifier names do not contain the underscore (_) character. This rule checks namespaces, types, members, and parameters.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1708 [Warning] CA1708: Identifiers should differ by more than case [Description]

Output: Identifiers for namespaces, types, members, and parameters cannot differ only by case because languages that target the common language runtime are not required to be case-sensitive.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1709 [Warning] CA1709: Identifiers should be cased correctly [Description]

Output: By convention, parameter names use camel casing and namespace, type, and member names use Pascal casing.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1710 [Warning] CA1710: Identifiers should have correct suffix [Description]

Output: By convention, the names of types that extend certain base types or that implement certain interfaces, or types that are derived from these types, have a suffix that is associated with the base type or interface.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1711 [Warning] CA1711: Identifiers should not have incorrect suffix [Description]

Output: By convention, only the names of types that extend certain base types or that implement certain interfaces, or types that are derived from these types, should end with specific reserved suffixes. Other type names should not use these reserved suffixes.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1712 [Warning] CA1712: Do not prefix enum values with type name [Description]

Output: Names of enumeration members are not prefixed by using the type name because development tools are expected to provide type information.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1713 [Warning] CA1713: Events should not have before or after prefix [Description]

Output: The name of an event starts with "Before" or "After". To name related events that are raised in a specific sequence, use the present or past tense to indicate the relative position in the sequence of actions.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1714 [Warning] CA1714: Flags enums should have plural names [Description]

Output: A public enumeration has the System.FlagsAttribute attribute, and its name does not end in "s". Types that are marked by using FlagsAttribute have names that are plural because the attribute indicates that more than one value can be specified.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1715 [Warning] CA1715: Identifiers should have correct prefix [Description]

Output: The name of an externally visible interface does not start with an uppercase "I". The name of a generic type parameter on an externally visible type or method does not start with an uppercase "T".

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1716 [Warning] CA1716: Identifiers should not match keywords [Description]

Output: A namespace name or a type name matches a reserved keyword in a programming language. Identifiers for namespaces and types should not match keywords that are defined by languages that target the common language runtime.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1717 [Warning] CA1717: Only FlagsAttribute enums should have plural names [Description]

Output: Naming conventions dictate that a plural name for an enumeration indicates that more than one value of the enumeration can be specified at the same time.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1719 [Warning] CA1719: Parameter names should not match member names [Description]

Output: A parameter name should communicate the meaning of a parameter and a member name should communicate the meaning of a member. It would be a rare design where these were the same. Naming a parameter the same as its member name is unintuitive and makes the library difficult to use.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1720 [Warning] CA1720: Identifiers should not contain type names [Description]

Output: The name of a parameter in an externally visible member contains a data type name, or the name of an externally visible member contains a language-specific data type name.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1721 [Warning] CA1721: Property names should not match get methods [Description]

Output: The name of a public or protected member starts with "Get" and otherwise matches the name of a public or protected property. "Get" methods and properties should have names that clearly distinguish their function.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1722 [Warning] CA1722: Identifiers should not have incorrect prefix [Description]

Output: By convention, only certain programming elements have names that begin with a specific prefix.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1724 [Warning] CA1724: Type Names Should Not Match Namespaces [Description]

Output: Type names should not match the names of namespaces that are defined in the .NET Framework class library. Violating this rule can reduce the usability of the library.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1725 [Warning] CA1725: Parameter names should match base declaration [Description]

Output: Consistent naming of parameters in an override hierarchy increases the usability of the method overrides. A parameter name in a derived method that differs from the name in the base declaration can cause confusion about whether the method is an override of the base method or a new overload of the method.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1726 [Warning] CA1726: Use preferred terms [Description]

Output: The name of an externally visible identifier includes a term for which an alternative, preferred term exists. Alternatively, the name includes the term "Flag" or "Flags".

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1800 [Warning] CA1800: Do not cast unnecessarily [Description]

Output: Duplicate casts decrease performance, especially when the casts are performed in compact iteration statements.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1801 [Warning] CA1801: Review unused parameters [Description]

Output: A method signature includes a parameter that is not used in the method body.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1802 [Warning] CA1802: Use Literals Where Appropriate [Description]

Output: A field is declared static and read-only (Shared and ReadOnly in Visual Basic), and is initialized by using a value that is computable at compile time. Because the value that is assigned to the targeted field is computable at compile time, change the declaration to a const (Const in Visual Basic) field so that the value is computed at compile time instead of at run time.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1804 [Warning] CA1804: Remove unused locals [Description]

Output: Unused local variables and unnecessary assignments increase the size of an assembly and decrease performance.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1806 [Warning] CA1806: Do not ignore method results [Description]

Output: A new object is created but never used; or a method that creates and returns a new string is called and the new string is never used; or a COM or P/Invoke method returns an HRESULT or error code that is never used.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1809 [Warning] CA1809: Avoid excessive locals [Description]

Output: A common performance optimization is to store a value in a processor register instead of memory, which is referred to as "enregistering the value". To increase the chance that all local variables are enregistered, limit the number of local variables to 64.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1810 [Warning] CA1810: Initialize reference type static fields inline [Description]

Output: When a type declares an explicit static constructor, the just-in-time (JIT) compiler adds a check to each static method and instance constructor of the type to make sure that the static constructor was previously called. Static constructor checks can decrease performance.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1811 [Warning] CA1811: Avoid uncalled private code [Description]

Output: A private or internal (assembly-level) member does not have callers in the assembly; it is not invoked by the common language runtime; and it is not invoked by a delegate.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1812 [Warning] CA1812: Avoid uninstantiated internal classes [Description]

Output: An instance of an assembly-level type is not created by code in the assembly.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1813 [Warning] CA1813: Avoid unsealed attributes [Description]

Output: The .NET Framework class library provides methods for retrieving custom attributes. By default, these methods search the attribute inheritance hierarchy. Sealing the attribute eliminates the search through the inheritance hierarchy and can improve performance.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1814 [Warning] CA1814: Prefer jagged arrays over multidimensional [Description]

Output: A jagged array is an array whose elements are arrays. The arrays that make up the elements can be of different sizes, leading to less wasted space for some sets of data.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1815 [Warning] CA1815: Override equals and operator equals on value types [Description]

Output: For value types, the inherited implementation of Equals uses the Reflection library and compares the contents of all fields. Reflection is computationally expensive, and comparing every field for equality might be unnecessary. If you expect users to compare or sort instances, or to use instances as hash table keys, your value type should implement Equals.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1816 [Warning] CA1816: Call GC.SuppressFinalize correctly [Description]

Output: A method that is an implementation of Dispose does not call GC.SuppressFinalize; or a method that is not an implementation of Dispose calls GC.SuppressFinalize; or a method calls GC.SuppressFinalize and passes something other than this (Me in Visual Basic).

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1819 [Warning] CA1819: Properties should not return arrays [Description]

Output: Arrays that are returned by properties are not write-protected, even when the property is read-only. To keep the array tamper-proof, the property must return a copy of the array. Typically, users will not understand the adverse performance implications of calling such a property.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1820 [Warning] CA1820: Test for empty strings using string length [Description]

Output: Comparing strings by using the String.Length property or the String.IsNullOrEmpty method is significantly faster than using Equals.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1821 [Warning] CA1821: Remove empty finalizers [Description]

Output: Whenever you can, avoid finalizers because of the additional performance overhead that is involved in tracking object lifetime. An empty finalizer incurs added overhead and delivers no benefit.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1822 [Warning] CA1822: Mark members as static [Description]

Output: Members that do not access instance data or call instance methods can be marked as static (Shared in Visual Basic). After you mark the methods as static, the compiler will emit nonvirtual call sites to these members. This can give you a measurable performance gain for performance-sensitive code.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1823 [Warning] CA1823: Avoid unused private fields [Description]

Output: Private fields were detected that do not appear to be accessed in the assembly.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1824 [Warning] CA1824: Mark assemblies with NeutralResourcesLanguageAttribute [Description]

Output: The NeutralResourcesLanguage attribute informs the ResourceManager of the language that was used to display the resources of a neutral culture for an assembly. This improves lookup performance for the first resource that you load and can reduce your working set.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1900 [Warning] CA1900: Value type fields should be portable [Description]

Output: This rule checks that structures that are declared by using explicit layout will align correctly when marshaled to unmanaged code on 64-bit operating systems.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1901 [Warning] CA1901: P/Invoke declarations should be portable [Description]

Output: This rule evaluates the size of each parameter and the return value of a P/Invoke, and verifies that the size of the parameter is correct when marshaled to unmanaged code on 32-bit and 64-bit operating systems.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA1903 [Warning] CA1903: Use only API from targeted framework [Description]

Output: A member or type is using a member or type that was introduced in a service pack that was not included together with the targeted framework of the project.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2000 [Warning] CA2000: Dispose objects before losing scope [Description]

Output: Because an exceptional event might occur that will prevent the finalizer of an object from running, the object should be explicitly disposed before all references to it are out of scope.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2001 [Warning] CA2001: Avoid calling problematic methods [Description]

Output: A member calls a potentially dangerous or problematic method.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2002 [Warning] CA2002: Do not lock on objects with weak identity [Description]

Output: An object is said to have a weak identity when it can be directly accessed across application domain boundaries. A thread that tries to acquire a lock on an object that has a weak identity can be blocked by a second thread in a different application domain that has a lock on the same object.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2003 [Warning] CA2003: Do not treat fibers as threads [Description]

Output: A managed thread is being treated as a Win32 thread.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2004 [Warning] CA2004: Remove calls to GC.KeepAlive [Description]

Output: If you convert to SafeHandle usage, remove all calls to GC.KeepAlive (object). In this case, classes should not have to call GC.KeepAlive. This assumes they do not have a finalizer but rely on SafeHandle to finalize the OS handle for them.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2006 [Warning] CA2006: Use SafeHandle to encapsulate native resources [Description]

Output: Use of IntPtr in managed code might indicate a potential security and reliability problem. All uses of IntPtr must be reviewed to determine whether use of a SafeHandle, or similar technology, is required in its place.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2100 [Warning] CA2100: Review SQL queries for security vulnerabilities [Description]

Output: A method sets the System.Data.IDbCommand.CommandText property by using a string that is built from a string argument to the method. This rule assumes that the string argument contains user input. A SQL command string that is built from user input is vulnerable to SQL injection attacks.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2101 [Warning] CA2101: Specify marshaling for P/Invoke string arguments [Description]

Output: A platform invoke member allows partially trusted callers, has a string parameter, and does not explicitly marshal the string. This can cause a potential security vulnerability.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2102 [Warning] CA2102: Catch non-CLSCompliant exceptions in general handlers [Description]

Output: A member in an assembly that is not marked by using the RuntimeCompatibilityAttribute or is marked RuntimeCompatibility(WrapNonExceptionThrows = false) contains a catch block that handles System.Exception and does not contain an immediately following general catch block.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2103 [Warning] CA2103: Review imperative security [Description]

Output: A method uses imperative security and might be constructing the permission by using state information or return values that can change as long as the demand is active. Use declarative security whenever possible.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2104 [Warning] CA2104: Do not declare read only mutable reference types [Description]

Output: An externally visible type contains an externally visible read-only field that is a mutable reference type. A mutable type is a type whose instance data can be modified.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2105 [Warning] CA2105: Array fields should not be read only [Description]

Output: When you apply the read-only (ReadOnly in Visual Basic) modifier to a field that contains an array, the field cannot be changed to reference a different array. However, the elements of the array that are stored in a read-only field can be changed.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2106 [Warning] CA2106: Secure asserts [Description]

Output: A method asserts a permission and no security checks are performed on the caller. Asserting a security permission without performing any security checks can leave an exploitable security weakness in your code.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2107 [Warning] CA2107: Review deny and permit only usage [Description]

Output: The PermitOnly method and CodeAccessPermission.Deny security actions should be used only by those who have an advanced knowledge of .NET Framework security. Code that uses these security actions should undergo a security review.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2108 [Warning] CA2108: Review declarative security on value types [Description]

Output: A public or protected value type is secured by Data Access or Link Demands.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2109 [Warning] CA2109: Review visible event handlers [Description]

Output: A public or protected event-handling method was detected. Event-handling methods should not be exposed unless absolutely necessary.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2111 [Warning] CA2111: Pointers should not be visible [Description]

Output: A pointer is not private, internal, or read-only. Malicious code can change the value of the pointer, which potentially gives access to arbitrary locations in memory or causes application or system failures.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2112 [Warning] CA2112: Secured types should not expose fields [Description]

Output: A public or protected type contains public fields and is secured by Link Demands. If code has access to an instance of a type that is secured by a link demand, the code does not have to satisfy the link demand to access the fields of the type.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2114 [Warning] CA2114: Method security should be a superset of type [Description]

Output: A method should not have both method-level and type-level declarative security for the same action.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2115 [Warning] CA2115: Call GC.KeepAlive when using native resources [Description]

Output: This rule detects errors that might occur because an unmanaged resource is being finalized while it is still being used in unmanaged code.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2116 [Warning] CA2116: APTCA methods should only call APTCA methods [Description]

Output: When the APTCA (AllowPartiallyTrustedCallersAttribute) is present on a fully trusted assembly, and the assembly executes code in another assembly that does not allow for partially trusted callers, a security exploit is possible.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2117 [Warning] CA2117: APTCA types should only extend APTCA base types [Description]

Output: When the APTCA is present on a fully trusted assembly, and a type in the assembly inherits from a type that does not allow for partially trusted callers, a security exploit is possible.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2118 [Warning] CA2118: Review SuppressUnmanagedCodeSecurityAttribute usage [Description]

Output: SuppressUnmanagedCodeSecurityAttribute changes the default security system behavior for members that execute unmanaged code that uses COM interop or operating system invocation. This attribute is primarily used to increase performance; however, the performance gains come together with significant security risks.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2119 [Warning] CA2119: Seal methods that satisfy private interfaces [Description]

Output: An inheritable public type provides an overridable method implementation of an internal (Friend in Visual Basic) interface. To fix a violation of this rule, prevent the method from being overridden outside the assembly.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2120 [Warning] CA2120: Secure serialization constructors [Description]

Output: This type has a constructor that takes a System.Runtime.Serialization.SerializationInfo object and a System.Runtime.Serialization.StreamingContext object (the signature of the serialization constructor). This constructor is not secured by a security check, but one or more of the regular constructors in the type are secured.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2121 [Warning] CA2121: Static constructors should be private [Description]

Output: The system calls the static constructor before the first instance of the type is created or any static members are referenced. If a static constructor is not private, it can be called by code other than the system. Depending on the operations that are performed in the constructor, this can cause unexpected behavior.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2122 [Warning] CA2122: Do not indirectly expose methods with link demands [Description]

Output: A public or protected member has Link Demands and is called by a member that does not perform any security checks. A link demand checks the permissions of the immediate caller only.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2123 [Warning] CA2123: Override link demands should be identical to base [Description]

Output: This rule matches a method to its base method, which is either an interface or a virtual method in another type, and then compares the link demands on each. If this rule is violated, a malicious caller can bypass the link demand just by calling the unsecured method.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2124 [Warning] CA2124: Wrap vulnerable finally clauses in outer try [Description]

Output: A public or protected method contains a try/finally block. The finally block appears to reset the security state and is not itself enclosed in a finally block.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2126 [Warning] CA2126: Type link demands require inheritance demands [Description]

Output: A public unsealed type is protected by using a link demand and has an overridable method. Neither the type nor the method is protected by using an inheritance demand.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2127 [Warning] CA2136: Members should not have conflicting transparency annotations [Description]

Output: Critical code cannot occur in a 100 percent−transparent assembly. This rule analyzes 100 percent−transparent assemblies for any SecurityCritical annotations at the type, field, and method levels.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2128 [Warning] CA2147: Transparent methods may not use security asserts [Description]

Output: This rule analyzes all methods and types in an assembly that is either 100 percent−transparent or mixed transparent/critical, and flags any declarative or imperative use of Assert.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2129 [Warning] CA2140: Transparent code must not reference security critical items [Description]

Output: Methods that are marked by SecurityTransparentAttribute call nonpublic members that are marked as SecurityCritical. This rule analyzes all methods and types in an assembly that is mixed transparent/critical, and flags any calls from transparent code to nonpublic critical code that are not marked as SecurityTreatAsSafe.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2130 [Warning] CA2130: Security critical constants should be transparent [Description]

Output: Transparency enforcement is not enforced for constant values because compilers inline constant values so that no lookup is required at run time. Constant fields should be security transparent so that code reviewers do not assume that transparent code cannot access the constant.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2131 [Warning] CA2131: Security critical types may not participate in type equivalence [Description]

Output: A type participates in type equivalence and either the type itself, or a member or field of the type, is marked by using the SecurityCriticalAttribute attribute. This rule occurs on any critical types or types that contain critical methods or fields that are participating in type equivalence. When the CLR detects such a type, it does not load it with a TypeLoadException at run time. Typically, this rule is raised only when users implement type equivalence manually instead of in by relying on tlbimp and the compilers to do the type equivalence.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2132 [Warning] CA2132: Default constructors must be at least as critical as base type default constructors [Description]

Output: Types and members that have the SecurityCriticalAttribute cannot be used by Silverlight application code. Security-critical types and members can be used only by trusted code in the .NET Framework for Silverlight class library. Because a public or protected construction in a derived class must have the same or greater transparency than its base class, a class in an application cannot be derived from a class marked as SecurityCritical.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2133 [Warning] CA2133: Delegates must bind to methods with consistent transparency [Description]

Output: This warning is raised on a method that binds a delegate that is marked by using the SecurityCriticalAttribute to a method that is transparent or that is marked by using the SecuritySafeCriticalAttribute. The warning also is raised on a method that binds a delegate that is transparent or safe-critical to a critical method.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2134 [Warning] CA2134: Methods must keep consistent transparency when overriding base methods [Description]

Output: This rule is raised when a method marked by using the SecurityCriticalAttribute overrides a method that is transparent or marked by using the SecuritySafeCriticalAttribute. The rule also is raised when a method that is transparent or marked by using the SecuritySafeCriticalAttribute overrides a method that is marked by using a SecurityCriticalAttribute. The rule is applied when overriding a virtual method or implementing an interface.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2135 [Warning] CA2135: Level 2 assemblies should not contain LinkDemands [Description]

Output: LinkDemands are deprecated in the level 2 security rule set. Instead of using LinkDemands to enforce security at JIT compilation time, mark the methods, types, and fields by using the SecurityCriticalAttribute attribute.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2136 [Warning] CA2136: Members should not have conflicting transparency annotations [Description]

Output: Transparency attributes are applied from code elements of larger scope to elements of smaller scope. The transparency attributes of code elements that have larger scope take precedence over transparency attributes of code elements that are contained in the first element. For example, a class that is marked by using the SecurityCriticalAttribute attribute cannot contain a method that is marked by using the SecuritySafeCriticalAttribute attribute.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2137 [Warning] CA2137: Transparent methods must contain only verifiable IL [Description]

Output: A method contains unverifiable code or returns a type by reference. This rule is raised on attempts by security transparent code to execute unverifiable microsoft intermediate language (MISL). However, the rule does not contain a full IL verifier, and instead uses heuristics to catch most violations of MSIL verification.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2138 [Warning] CA2138: Transparent methods must not call methods with the SuppressUnmanagedCodeSecurity attribute [Description]

Output: A security transparent method calls a method that is marked by using the SuppressUnmanagedCodeSecurityAttribute attribute.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2139 [Warning] CA2139: Transparent methods may not use the HandleProcessCorruptingExceptions attribute [Description]

Output: This rule is raised by any method that is transparent and attempts to handle a process corrupting exception by using the HandleProcessCorruptedStateExceptionsAttribute attribute. A process corrupting exception is a CLR version 4.0 exception classification of exceptions such as AccessViolationException. The HandleProcessCorruptedStateExceptionsAttribute attribute may be used only by security critical methods, and will be ignored if it is applied to a transparent method.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2140 [Warning] CA2140: Transparent code must not reference security critical items [Description]

Output: A code element that is marked by using the SecurityCriticalAttribute attribute is security critical. A transparent method cannot use a security critical element. If a transparent type attempts to use a security critical type, a TypeAccessException, MethodAccessException, or FieldAccessException is raised.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2141 [Warning] CA2141:Transparent methods must not satisfy LinkDemands [Description]

Output: A security transparent method calls a method in an assembly that is not marked by using the APTCA, or a security transparent method satisfies a LinkDemand for a type or a method.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2142 [Warning] CA2142: Transparent code should not be protected with LinkDemands [Description]

Output: This rule is raised on transparent methods that require LinkDemands to access them. Security transparent code should not be responsible for verifying the security of an operation, and therefore should not demand permissions.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2143 [Warning] CA2143: Transparent methods should not use security demands [Description]

Output: Security transparent code should not be responsible for verifying the security of an operation, and therefore should not demand permissions. Security transparent code should use full demands to make security decisions and safe-critical code should not rely on transparent code to have made the full demand.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2144 [Warning] CA2144: Transparent code should not load assemblies from byte arrays [Description]

Output: The security review for transparent code is not as complete as the security review for critical code because transparent code cannot perform security sensitive actions. Assemblies that are loaded from a byte array might not be noticed in transparent code, and that byte array might contain critical, or more important safe-critical code, that does have to be audited.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2145 [Warning] CA2145: Transparent methods should not be decorated with the SuppressUnmanagedCodeSecurityAttribute [Description]

Output: Methods that are decorated by the SuppressUnmanagedCodeSecurityAttribute attribute have an implicit LinkDemand put upon any method that calls it. This LinkDemand requires that the calling code be security critical. Marking the method that uses SuppressUnmanagedCodeSecurity by using the SecurityCriticalAttribute attribute makes this requirement more obvious for callers of the method.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2146 [Warning] CA2146: Types must be at least as critical as their base types and interfaces [Description]

Output: This rule is raised when a derived type has a security transparency attribute that is not as critical as its base type or implemented interface. Only critical types can derive from critical base types or implement critical interfaces, and only critical or safe-critical types can derive from safe-critical base types or implement safe-critical interfaces.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2147 [Warning] CA2147: Transparent methods may not use security asserts [Description]

Output: Code that is marked as SecurityTransparentAttribute is not granted sufficient permissions to assert.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2149 [Warning] CA2149: Transparent methods must not call into native code [Description]

Output: This rule is raised on any transparent method that calls directly into native code (for example, through a P/Invoke). Violations of this rule lead to a MethodAccessException in the level 2 transparency model and a full demand for UnmanagedCode in the level 1 transparency model.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2200 [Warning] CA2200: Rethrow to preserve stack details [Description]

Output: An exception is rethrown and the exception is explicitly specified in the throw statement. If an exception is rethrown by specifying the exception in the throw statement, the list of method calls between the original method that threw the exception and the current method is lost.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2201 [Warning] CA2201: Do not raise reserved exception types [Description]

Output: This makes the original error difficult to detect and debug.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2202 [Warning] CA2202: Do not dispose objects multiple times [Description]

Output: A method implementation contains code paths that could cause multiple calls to System.IDisposable.Dispose or a Dispose equivalent (such as a Close() method on some types) on the same object.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2204 [Warning] CA2204: Literals should be spelled correctly [Description]

Output: A literal string in a method body contains one or more words that are not recognized by the Microsoft spelling checker library.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2205 [Warning] CA2205: Use managed equivalents of Win32 API [Description]

Output: An operating system invoke method is defined and a method that has the equivalent functionality is located in the .NET Framework class library.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2207 [Warning] CA2207: Initialize value type static fields inline [Description]

Output: A value type declares an explicit static constructor. To fix a violation of this rule, initialize all static data when it is declared and remove the static constructor.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2208 [Warning] CA2208: Instantiate argument exceptions correctly [Description]

Output: A call is made to the default (parameterless) constructor of an exception type that is or derives from ArgumentException, or an incorrect string argument is passed to a parameterized constructor of an exception type that is or derives from ArgumentException.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2210 [Warning] CA2210: Assemblies should have valid strong names [Description]

Output: The strong name protects clients from unknowingly loading an assembly that has been tampered with. Assemblies without strong names should not be deployed outside very limited scenarios. If you share or distribute assemblies that are not correctly signed, the assembly can be tampered with, the common language runtime might not load the assembly, or the user might have to disable verification on his or her computer.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2211 [Warning] CA2211: Non-constant fields should not be visible [Description]

Output: Static fields that are neither constants nor read-only are not thread-safe. Access to such a field must be carefully controlled and requires advanced programming techniques to synchronize access to the class object.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2212 [Warning] CA2212: Do not mark serviced components with WebMethod [Description]

Output: A method in a type that inherits from System.EnterpriseServices.ServicedComponent is marked by using System.Web.Services.WebMethodAttribute. Because WebMethodAttribute and a ServicedComponent method have conflicting behavior and requirements for context and transaction flow, the behavior of the method will be incorrect in some scenarios.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2213 [Warning] CA2213: Disposable fields should be disposed [Description]

Output: A type that implements System.IDisposable declares fields that are of types that also implement IDisposable. The Dispose method of the field is not called by the Dispose method of the declaring type.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2214 [Warning] CA2214: Do not call overridable methods in constructors [Description]

Output: When a constructor calls a virtual method, the constructor for the instance that invokes the method may not have executed.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2215 [Warning] CA2215: Dispose methods should call base class dispose [Description]

Output: If a type inherits from a disposable type, it must call the Dispose method of the base type from its own Dispose method.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2216 [Warning] CA2216: Disposable types should declare finalizer [Description]

Output: A type that implements System.IDisposable and has fields that suggest the use of unmanaged resources does not implement a finalizer, as described by Object.Finalize.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2217 [Warning] CA2217: Do not mark enums with FlagsAttribute [Description]

Output: An externally visible enumeration is marked by using FlagsAttribute, and it has one or more values that are not powers of two or a combination of the other defined values on the enumeration.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2218 [Warning] CA2218: Override GetHashCode on overriding Equals [Description]

Output: GetHashCode returns a value, based on the current instance, that is suited for hashing algorithms and data structures such as a hash table. Two objects that are the same type and are equal must return the same hash code.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2219 [Warning] CA2219: Do not raise exceptions in exception clauses [Description]

Output: When an exception is raised in a finally or fault clause, the new exception hides the active exception. When an exception is raised in a filter clause, the run time silently catches the exception. This makes the original error difficult to detect and debug.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2220 [Warning] CA2220: Finalizers should call base class finalizer [Description]

Output: Finalization must be propagated through the inheritance hierarchy. To guarantee this, types must call their base class Finalize method in their own Finalize method.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2221 [Warning] CA2221: Finalizers should be protected [Description]

Output: Finalizers must use the family access modifier.

Code Analysis Warnings for Managed Code by CheckId


Input: [CheckId] CA2222 [Warning] CA2222: Do not decrease inherited member visibility [Description]

Output: You should not change the access modifier for inherited members. Changing an inherited member to private does not prevent callers from accessing the base class implementation of the method.

Code Analysis Warnings for Managed Code by CheckId