You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/code-quality/ca1052-static-holder-types-should-be-sealed.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ translation.priority.mt:
50
50
This rule assumes that a type that contains only static members is not designed to be inherited, because the type does not provide any functionality that can be overridden in a derived type. A type that is not meant to be inherited should be marked with the `sealed` modifier to prohibit its use as a base type.
51
51
52
52
## How to Fix Violations
53
-
To fix a violation of this rule, mark the type as `sealed`. If you are targeting [!INCLUDE[dnprdnshort](../code-quality/includes/dnprdnshort_md.md)] 2.0 or earlier, a better approach is to mark the type as `static`. In this manner, you avoid having to declare a private constructor to prevent the class from being created.
53
+
To fix a violation of this rule, mark the type as `sealed`. If you are targeting [!INCLUDE[dnprdnshort](../code-quality/includes/dnprdnshort_md.md)] 2.0 or later, a better approach is to mark the type as `static`. In this manner, you avoid having to declare a private constructor to prevent the class from being created.
54
54
55
55
## When to Suppress Warnings
56
56
Suppress a warning from this rule only if the type is designed to be inherited. The absence of the `sealed` modifier suggests that the type is useful as a base type.
Copy file name to clipboardexpand all lines: docs/code-quality/ca1309-use-ordinal-stringcomparison.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ translation.priority.mt:
47
47
A string comparison operation that is nonlinguistic does not set the <xref:System.StringComparison> parameter to either **Ordinal** or **OrdinalIgnoreCase**.
48
48
49
49
## Rule Description
50
-
Many string operations, most important the <xref:System.String.Compare%2A?displayProperty=fullName> and <xref:System.String.Equals%2A?displayProperty=fullName> methods, now provide an overload that accepts a <xref:System.StringComparision?displayProperty=fullName> enumeration value as a parameter.
50
+
Many string operations, most important the <xref:System.String.Compare%2A?displayProperty=fullName> and <xref:System.String.Equals%2A?displayProperty=fullName> methods, now provide an overload that accepts a <xref:System.StringComparison?displayProperty=fullName> enumeration value as a parameter.
51
51
52
52
When you specify either **StringComparison.Ordinal** or **StringComparison.OrdinalIgnoreCase**, the string comparison will be nonlinguistic. That is, the features that are specific to the natural language are ignored when comparison decisions are made. This means the decisions are based on simple byte comparisons and ignore casing or equivalence tables that are parameterized by culture. As a result, by explicitly setting the parameter to either the **StringComparison.Ordinal** or **StringComparison.OrdinalIgnoreCase**, your code often gains speed, increases correctness, and becomes more reliable.
Copy file name to clipboardexpand all lines: docs/code-quality/ca1812-avoid-uninstantiated-internal-classes.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -77,7 +77,7 @@ translation.priority.mt:
77
77
## When to Suppress Warnings
78
78
It is safe to suppress a warning from this rule. We recommend that you suppress this warning in the following situations:
79
79
80
-
- The class is created through late-bound reflection methods such as <xref:System.Activator.CreateInstance?displayProperty=fullName>.
80
+
- The class is created through late-bound reflection methods such as <xref:System.Activator.CreateInstance%2A?displayProperty=fullName>.
81
81
82
82
- The class is created automatically by the runtime or [!INCLUDE[vstecasp](../code-quality/includes/vstecasp_md.md)]. For example, classes that implement <xref:System.Configuration.IConfigurationSectionHandler?displayProperty=fullName> or <xref:System.Web.IHttpHandler?displayProperty=fullName>.
Copy file name to clipboardexpand all lines: docs/code-quality/ca1816-call-gc-suppressfinalize-correctly.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ translation.priority.ht:
53
53
## Rule Description
54
54
The <xref:System.IDisposable.Dispose%2A?displayProperty=fullName> method lets users release resources at any time before the object becoming available for garbage collection. If the <xref:System.IDisposable.Dispose%2A?displayProperty=fullName> method is called, it frees resources of the object. This makes finalization unnecessary. <xref:System.IDisposable.Dispose%2A?displayProperty=fullName> should call <xref:System.GC.SuppressFinalize%2A?displayProperty=fullName> so the garbage collector does not call the finalizer of the object.
55
55
56
-
To prevent derived types with finalizers from having to re-implement [System.IDisposable](assetId:///System.IDisposable?qualifyHint=True&autoUpgrade=False) and to call it, unsealed types without finalizers should still call <xref:System.GC.SuppressFinalize%2A?displayProperty=fullName>.
56
+
To prevent derived types with finalizers from having to re-implement <xref:System.IDisposable> and to call it, unsealed types without finalizers should still call <xref:System.GC.SuppressFinalize%2A?displayProperty=fullName>.
Copy file name to clipboardexpand all lines: docs/code-quality/ca1819-properties-should-not-return-arrays.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ translation.priority.mt:
53
53
To fix a violation of this rule, either make the property a method or change the property to return a collection.
54
54
55
55
## When to Suppress Warnings
56
-
Attributes can contain properties that return arrays, but cannot contain properties that return collections. You can suppress a warning that is raised for a property of an attribute that is derived from the [System.Attribute](assetId:///System.Attribute?qualifyHint=False&autoUpgrade=True) class. Otherwise, do not suppress a warning from this rule.
56
+
Attributes can contain properties that return arrays, but cannot contain properties that return collections. You can suppress a warning that is raised for a property of an attribute that is derived from the <xref:System.Attribute> class. Otherwise, do not suppress a warning from this rule.
57
57
58
58
## Example Violation
59
59
@@ -81,7 +81,7 @@ translation.priority.mt:
81
81
### Description
82
82
The following example fixes the violation by changing the property to return a
The following example fixes the violation by changing the property to return a <xref:System.Collection.ObjectModel.Collection?displayProperty=fullName>.
100
+
The following example fixes the violation by changing the property to return a <xref:System.Collections.ObjectModel.Collection%601?displayProperty=fullName>.
Copy file name to clipboardexpand all lines: docs/code-quality/ca2100-review-sql-queries-for-security-vulnerabilities.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,7 @@ translation.priority.mt:
64
64
65
65
-<xref:System.Data.OracleClient.OracleCommand?displayProperty=fullName> and <xref:System.Data.OracleClient.OracleDataAdapter?displayProperty=fullName>
66
66
67
-
-[System.Data.SqlServerCe.SqlCeCommand](assetId:///System.Data.SqlServerCe.SqlCeCommand?qualifyHint=False&autoUpgrade=True) and [System.Data.SqlServerCe.SqlCeDataAdapter](assetId:///System.Data.SqlServerCe.SqlCeDataAdapter?qualifyHint=False&autoUpgrade=True)
67
+
-[System.Data.SqlServerCe.SqlCeCommand](https://msdn.microsoft.com/library/system.data.sqlserverce.sqlcecommand.aspx) and [System.Data.SqlServerCe.SqlCeDataAdapter](https://msdn.microsoft.com/library/system.data.sqlserverce.sqlcedataadapter.aspx)
68
68
69
69
-<xref:System.Data.SqlClient.SqlCommand?displayProperty=fullName> and <xref:System.Data.SqlClient.SqlDataAdapter?displayProperty=fullName>
Copy file name to clipboardexpand all lines: docs/code-quality/ca2208-instantiate-argument-exceptions-correctly.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -45,9 +45,9 @@ translation.priority.ht:
45
45
## Cause
46
46
Possible causes include the following situations:
47
47
48
-
- A call is made to the default (parameterless) constructor of an exception type that is, or derives from [System.ArgumentException](assetId:///System.ArgumentException?qualifyHint=True&autoUpgrade=True).
48
+
- A call is made to the default (parameterless) constructor of an exception type that is, or derives from <xref:System.ArgumentException>.
49
49
50
-
- An incorrect string argument is passed to a parameterized constructor of an exception type that is, or derives from [System.ArgumentException.](assetId:///System.ArgumentException.?qualifyHint=True&autoUpgrade=True)
50
+
- An incorrect string argument is passed to a parameterized constructor of an exception type that is, or derives from <xref:System.ArgumentException>.
51
51
52
52
## Rule Description
53
53
Instead of calling the default constructor, call one of the constructor overloads that allows a more meaningful exception message to be provided. The exception message should target the developer and clearly explain the error condition and how to correct or avoid the exception.
Copy file name to clipboardexpand all lines: docs/code-quality/ca2218-override-gethashcode-on-overriding-equals.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -48,23 +48,23 @@ translation.priority.ht:
48
48
## Rule Description
49
49
<xref:System.Object.GetHashCode%2A> 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 to ensure that instances of the following types work correctly:
- Types that implement <xref:System.Collections.Generic.IEqualityComparer?displayProperty=fullName>
67
+
- Types that implement <xref:System.Collections.Generic.IEqualityComparer%601?displayProperty=fullName>
68
68
69
69
## How to Fix Violations
70
70
To fix a violation of this rule, provide an implementation of <xref:System.Object.GetHashCode%2A>. For a pair of objects of the same type, you must ensure that the implementation returns the same value if your implementation of <xref:System.Object.Equals%2A> returns `true` for the pair.
The following example fixes the two previous violations by providing an overrideable implementation of [ISerializable.GetObjectData](assetId:///ISerializable.GetObjectData?qualifyHint=False&autoUpgrade=False) on the Book class and by providing an implementation of assetId:///ISerializable.GetObjectData?qualifyHint=False&autoUpgrade=False on the Library class.
71
+
The following example fixes the two previous violations by providing an overrideable implementation of <xref:System.Runtime.Serialization.ISerializable.GetObjectData> on the Book class and by providing an implementation of `GetObjectData` on the Library class.
Copy file name to clipboardexpand all lines: docs/code-quality/ca2242-test-for-nan-correctly.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -42,13 +42,13 @@ translation.priority.ht:
42
42
|Breaking Change|Non Breaking|
43
43
44
44
## Cause
45
-
An expression tests a value against <xref:System.Single.Nan?displayProperty=fullName> or <xref:System.Double.Nan?displayProperty=fullName>.
45
+
An expression tests a value against <xref:System.Single.NaN?displayProperty=fullName> or <xref:System.Double.NaN?displayProperty=fullName>.
46
46
47
47
## Rule Description
48
48
<xref:System.Double.NaN?displayProperty=fullName>, which represents not-a-number, results when an arithmetic operation is undefined. Any expression that tests equality between a value and <xref:System.Double.NaN?displayProperty=fullName> always returns `false`. Any expression that tests inequality between a value and <xref:System.Double.NaN?displayProperty=fullName> always returns `true`.
49
49
50
50
## How to Fix Violations
51
-
To fix a violation of this rule and accurately determine whether a value represents <xref:System.Double.NaN?displayProperty=fullName>, use <xref:System.Single.IsNan%2A?displayProperty=fullName> or <xref:System.Double.IsNan%2A?displayProperty=fullName> to test the value.
51
+
To fix a violation of this rule and accurately determine whether a value represents <xref:System.Double.NaN?displayProperty=fullName>, use <xref:System.Single.IsNaN%2A?displayProperty=fullName> or <xref:System.Double.IsNaN%2A?displayProperty=fullName> to test the value.
Copy file name to clipboardexpand all lines: docs/data-tools/troubleshooting-service-references.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ translation.priority.mt:
39
39
This topic lists common issues that may occur when you are working with [!INCLUDE[vsindigo](../data-tools/includes/vsindigo_md.md)] or [!INCLUDE[ssAstoria](../data-tools/includes/ssastoria_md.md)] references in [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)].
40
40
41
41
## Error Returning Data from a Service
42
-
When you return a `DataSet` or `DataTable` from a service, you may receive a "The maximum size quota for incoming messages has been exceeded" exception. By default, the `MaxReceivedMessageSize` property for some bindings is set to a relatively small value to limit exposure to denial-of-service attacks. You can increase this value to prevent the exception. For more information, see <xref:System.ServiceModel.BasicHttpBinding.MaxReceivedMessageSize%2A>.
42
+
When you return a `DataSet` or `DataTable` from a service, you may receive a "The maximum size quota for incoming messages has been exceeded" exception. By default, the `MaxReceivedMessageSize` property for some bindings is set to a relatively small value to limit exposure to denial-of-service attacks. You can increase this value to prevent the exception. For more information, see <xref:System.ServiceModel.HttpBindingBase.MaxReceivedMessageSize%2A>.
0 commit comments