task
stringlengths
24
71
input
stringlengths
8
2.38k
output
stringlengths
1
2.34k
options
list
pageTitle
stringlengths
4
140
outputColName
stringlengths
1
79
url
stringlengths
41
160
wdcFile
stringlengths
71
74
65674ef5_StringWriter_Class__System_IO___e_the_example_in_this_topic___
[To do this...] Write to a text file.
How to: Write Text to a File
[]
StringWriter Class (System.IO)
See the example in this topic...
https://msdn.microsoft.com/en-us/library/hs9kt2e9(v=vs.100).aspx
17/1438042987228.91_20150728002307-00074-ip-10-236-191-2_866907388_4.json
65674ef5_StringWriter_Class__System_IO___e_the_example_in_this_topic___
[To do this...] Read from a text file.
How to: Read Text from a File
[]
StringWriter Class (System.IO)
See the example in this topic...
https://msdn.microsoft.com/en-us/library/hs9kt2e9(v=vs.100).aspx
17/1438042987228.91_20150728002307-00074-ip-10-236-191-2_866907388_4.json
65674ef5_StringWriter_Class__System_IO___e_the_example_in_this_topic___
[To do this...] Append text to a file.
How to: Open and Append to a Log File File.AppendText FileInfo.AppendText
[]
StringWriter Class (System.IO)
See the example in this topic...
https://msdn.microsoft.com/en-us/library/hs9kt2e9(v=vs.100).aspx
17/1438042987228.91_20150728002307-00074-ip-10-236-191-2_866907388_4.json
65674ef5_StringWriter_Class__System_IO___e_the_example_in_this_topic___
[To do this...] Get the size of a file.
FileInfo.Length
[]
StringWriter Class (System.IO)
See the example in this topic...
https://msdn.microsoft.com/en-us/library/hs9kt2e9(v=vs.100).aspx
17/1438042987228.91_20150728002307-00074-ip-10-236-191-2_866907388_4.json
65674ef5_StringWriter_Class__System_IO___e_the_example_in_this_topic___
[To do this...] Get the attributes of a file.
File.GetAttributes
[]
StringWriter Class (System.IO)
See the example in this topic...
https://msdn.microsoft.com/en-us/library/hs9kt2e9(v=vs.100).aspx
17/1438042987228.91_20150728002307-00074-ip-10-236-191-2_866907388_4.json
65674ef5_StringWriter_Class__System_IO___e_the_example_in_this_topic___
[To do this...] Set the attributes of a file.
File.SetAttributes
[]
StringWriter Class (System.IO)
See the example in this topic...
https://msdn.microsoft.com/en-us/library/hs9kt2e9(v=vs.100).aspx
17/1438042987228.91_20150728002307-00074-ip-10-236-191-2_866907388_4.json
65674ef5_StringWriter_Class__System_IO___e_the_example_in_this_topic___
[To do this...] Determine if a file exists.
File.Exists
[]
StringWriter Class (System.IO)
See the example in this topic...
https://msdn.microsoft.com/en-us/library/hs9kt2e9(v=vs.100).aspx
17/1438042987228.91_20150728002307-00074-ip-10-236-191-2_866907388_4.json
65674ef5_StringWriter_Class__System_IO___e_the_example_in_this_topic___
[To do this...] Read from a binary file.
How to: Read and Write to a Newly Created Data File
[]
StringWriter Class (System.IO)
See the example in this topic...
https://msdn.microsoft.com/en-us/library/hs9kt2e9(v=vs.100).aspx
17/1438042987228.91_20150728002307-00074-ip-10-236-191-2_866907388_4.json
65674ef5_StringWriter_Class__System_IO___e_the_example_in_this_topic___
[To do this...] Write to a binary file.
How to: Read and Write to a Newly Created Data File
[]
StringWriter Class (System.IO)
See the example in this topic...
https://msdn.microsoft.com/en-us/library/hs9kt2e9(v=vs.100).aspx
17/1438042987228.91_20150728002307-00074-ip-10-236-191-2_866907388_4.json
3390109a_Members__System_Data_SqlTypes___Description
[Name] MaxValue [Description]
Represents the maximum valid date value for a SqlDateTime structure.
[]
SqlDateTime Members (System.Data.SqlTypes)
Description
https://msdn.microsoft.com/en-us/library/system.data.sqltypes.sqldatetime_members(v=vs.80).aspx
17/1438042987228.91_20150728002307-00166-ip-10-236-191-2_883958820_1.json
3390109a_Members__System_Data_SqlTypes___Description
[Name] MinValue [Description]
Represents the minimum valid date value for a SqlDateTime structure.
[]
SqlDateTime Members (System.Data.SqlTypes)
Description
https://msdn.microsoft.com/en-us/library/system.data.sqltypes.sqldatetime_members(v=vs.80).aspx
17/1438042987228.91_20150728002307-00166-ip-10-236-191-2_883958820_1.json
3390109a_Members__System_Data_SqlTypes___Description
[Name] Null [Description]
Represents a null value that can be assigned to the Value property of an instance of the SqlDateTime structure.
[]
SqlDateTime Members (System.Data.SqlTypes)
Description
https://msdn.microsoft.com/en-us/library/system.data.sqltypes.sqldatetime_members(v=vs.80).aspx
17/1438042987228.91_20150728002307-00166-ip-10-236-191-2_883958820_1.json
3390109a_Members__System_Data_SqlTypes___Description
[Name] SQLTicksPerHour [Description]
A constant whose value is the number of ticks equivalent to one hour.
[]
SqlDateTime Members (System.Data.SqlTypes)
Description
https://msdn.microsoft.com/en-us/library/system.data.sqltypes.sqldatetime_members(v=vs.80).aspx
17/1438042987228.91_20150728002307-00166-ip-10-236-191-2_883958820_1.json
3390109a_Members__System_Data_SqlTypes___Description
[Name] SQLTicksPerMinute [Description]
A constant whose value is the number of ticks equivalent to one minute.
[]
SqlDateTime Members (System.Data.SqlTypes)
Description
https://msdn.microsoft.com/en-us/library/system.data.sqltypes.sqldatetime_members(v=vs.80).aspx
17/1438042987228.91_20150728002307-00166-ip-10-236-191-2_883958820_1.json
3390109a_Members__System_Data_SqlTypes___Description
[Name] SQLTicksPerSecond [Description]
A constant whose value is the number of ticks equivalent to one second.
[]
SqlDateTime Members (System.Data.SqlTypes)
Description
https://msdn.microsoft.com/en-us/library/system.data.sqltypes.sqldatetime_members(v=vs.80).aspx
17/1438042987228.91_20150728002307-00166-ip-10-236-191-2_883958820_1.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1000 [Warning] CA1000: Do not declare static members on generic types [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1001 [Warning] CA1001: Types that own disposable fields should be disposable [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1002 [Warning] CA1002: Do not expose generic lists [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1003 [Warning] CA1003: Use generic event handler instances [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1004 [Warning] CA1004: Generic methods should provide type parameter [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1005 [Warning] CA1005: Avoid excessive parameters on generic types [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1006 [Warning] CA1006: Do not nest generic types in member signatures [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1007 [Warning] CA1007: Use generics where appropriate [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1008 [Warning] CA1008: Enums should have zero value [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1009 [Warning] CA1009: Declare event handlers correctly [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1010 [Warning] CA1010: Collections should implement generic interface [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1011 [Warning] CA1011: Consider passing base types as parameters [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1012 [Warning] CA1012: Abstract types should not have constructors [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1013 [Warning] CA1013: Overload operator equals on overloading add and subtract [Description]
A public or protected type implements the addition or subtraction operators without implementing the equality operator.
[]
Code Analysis Warnings for Managed Code by CheckId
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1014 [Warning] CA1014: Mark assemblies with CLSCompliantAttribute [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1016 [Warning] CA1016: Mark assemblies with AssemblyVersionAttribute [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1017 [Warning] CA1017: Mark assemblies with ComVisibleAttribute [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1018 [Warning] CA1018: Mark attributes with AttributeUsageAttribute [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1019 [Warning] CA1019: Define accessors for attribute arguments [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1020 [Warning] CA1020: Avoid namespaces with few types [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1021 [Warning] CA1021: Avoid out parameters [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1023 [Warning] CA1023: Indexers should not be multidimensional [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1024 [Warning] CA1024: Use properties where appropriate [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1025 [Warning] CA1025: Replace repetitive arguments with params array [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1026 [Warning] CA1026: Default parameters should not be used [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1027 [Warning] CA1027: Mark enums with FlagsAttribute [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1028 [Warning] CA1028: Enum storage should be Int32 [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1030 [Warning] CA1030: Use events where appropriate [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1031 [Warning] CA1031: Do not catch general exception types [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1032 [Warning] CA1032: Implement standard exception constructors [Description]
Failure to provide the full set of constructors can make it difficult to correctly handle exceptions.
[]
Code Analysis Warnings for Managed Code by CheckId
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1033 [Warning] CA1033: Interface methods should be callable by child types [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1034 [Warning] CA1034: Nested types should not be visible [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1035 [Warning] CA1035: ICollection implementations have strongly typed members [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1036 [Warning] CA1036: Override methods on comparable types [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1038 [Warning] CA1038: Enumerators should be strongly typed [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1039 [Warning] CA1039: Lists are strongly typed [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1040 [Warning] CA1040: Avoid empty interfaces [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1041 [Warning] CA1041: Provide ObsoleteAttribute message [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1043 [Warning] CA1043: Use integral or string argument for indexers [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1044 [Warning] CA1044: Properties should not be write only [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1045 [Warning] CA1045: Do not pass types by reference [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1046 [Warning] CA1046: Do not overload operator equals on reference types [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1047 [Warning] CA1047: Do not declare protected members in sealed types [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1048 [Warning] CA1048: Do not declare virtual members in sealed types [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1049 [Warning] CA1049: Types that own native resources should be disposable [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1050 [Warning] CA1050: Declare types in namespaces [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1051 [Warning] CA1051: Do not declare visible instance fields [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1052 [Warning] CA1052: Static holder types should be sealed [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1053 [Warning] CA1053: Static holder types should not have constructors [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1054 [Warning] CA1054: URI parameters should not be strings [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1055 [Warning] CA1055: URI return values should not be strings [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1056 [Warning] CA1056: URI properties should not be strings [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1057 [Warning] CA1057: String URI overloads call System.Uri overloads [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1058 [Warning] CA1058: Types should not extend certain base types [Description]
An externally visible type extends certain base types. Use one of the alternatives.
[]
Code Analysis Warnings for Managed Code by CheckId
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1059 [Warning] CA1059: Members should not expose certain concrete types [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1060 [Warning] CA1060: Move P/Invokes to NativeMethods class [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1061 [Warning] CA1061: Do not hide base class methods [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1062 [Warning] CA1062: Validate arguments of public methods [Description]
All reference arguments that are passed to externally visible methods should be checked against null.
[]
Code Analysis Warnings for Managed Code by CheckId
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1063 [Warning] CA1063: Implement IDisposable correctly [Description]
All IDisposable types should implement the Dispose pattern correctly.
[]
Code Analysis Warnings for Managed Code by CheckId
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1064 [Warning] CA1064: Exceptions should be public [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1065 [Warning] CA1065: Do not raise exceptions in unexpected locations [Description]
A method that is not expected to throw exceptions throws an exception.
[]
Code Analysis Warnings for Managed Code by CheckId
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1300 [Warning] CA1300: Specify MessageBoxOptions [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1301 [Warning] CA1301: Avoid duplicate accelerators [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1302 [Warning] CA1302: Do not hardcode locale specific strings [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1303 [Warning] CA1303: Do not pass literals as localized parameters [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1304 [Warning] CA1304: Specify CultureInfo [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1305 [Warning] CA1305: Specify IFormatProvider [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1306 [Warning] CA1306: Set locale for data types [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1307 [Warning] CA1307: Specify StringComparison [Description]
A string comparison operation uses a method overload that does not set a StringComparison parameter.
[]
Code Analysis Warnings for Managed Code by CheckId
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1308 [Warning] CA1308: Normalize strings to uppercase [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1309 [Warning] CA1309: Use ordinal StringComparison [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1400 [Warning] CA1400: P/Invoke entry points should exist [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1401 [Warning] CA1401: P/Invokes should not be visible [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1402 [Warning] CA1402: Avoid overloads in COM visible interfaces [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1403 [Warning] CA1403: Auto layout types should not be COM visible [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1404 [Warning] CA1404: Call GetLastError immediately after P/Invoke [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1405 [Warning] CA1405: COM visible type base types should be COM visible [Description]
A COM-visible type derives from a type that is not COM-visible.
[]
Code Analysis Warnings for Managed Code by CheckId
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1406 [Warning] CA1406: Avoid Int64 arguments for Visual Basic 6 clients [Description]
Visual Basic 6 COM clients cannot access 64-bit integers.
[]
Code Analysis Warnings for Managed Code by CheckId
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1407 [Warning] CA1407: Avoid static members in COM visible types [Description]
COM does not support static methods.
[]
Code Analysis Warnings for Managed Code by CheckId
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1408 [Warning] CA1408: Do not use AutoDual ClassInterfaceType [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1409 [Warning] CA1409: Com visible types should be creatable [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1410 [Warning] CA1410: COM registration methods should be matched [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1411 [Warning] CA1411: COM registration methods should not be visible [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1412 [Warning] CA1412: Mark ComSource Interfaces as IDispatch [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json
4b3479f6_gs_for_Managed_Code_by_CheckId__Description
[CheckId] CA1413 [Warning] CA1413: Avoid non-public fields in COM visible value types [Description]
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
Description
https://msdn.microsoft.com/en-us/library/dd380629(v=vs.110).aspx
17/1438042987402.78_20150728002307-00206-ip-10-236-191-2_869466054_0.json