Skip to content

Commit f0a026f

Browse files
authored
Merge branch 'master' into vcraic0718a
2 parents 27dfcde + 0d99338 commit f0a026f

File tree

291 files changed

+2038
-2014
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+2038
-2014
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5730,6 +5730,11 @@
57305730
"source_path": "mac/benefits-vsmac-over-xs.md",
57315731
"redirect_url": "/visualstudio/mac/",
57325732
"redirect_document_id": false
5733+
},
5734+
{
5735+
"source_path": "docs/cross-platform/overview-of-visual-studio-tools-for-unity.md",
5736+
"redirect_url": "/visualstudio/cross-platform/visual-studio-tools-for-unity",
5737+
"redirect_document_id": false
57335738
}
57345739

57355740
]

docs/code-quality/ca1020-avoid-namespaces-with-few-types.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ ms.workload:
1818
- "multiple"
1919
---
2020
# CA1020: Avoid namespaces with few types
21+
2122
|||
2223
|-|-|
2324
|TypeName|AvoidNamespacesWithFewTypes|
@@ -26,16 +27,20 @@ ms.workload:
2627
|Breaking Change|Breaking|
2728

2829
## Cause
29-
A namespace other than the global namespace contains fewer than five types.
30+
31+
A namespace other than the global namespace contains fewer than five types.
3032

3133
## Rule Description
32-
Make sure that each of your namespaces has a logical organization, and that a valid reason exists to put types in a sparsely populated namespace. Namespaces should contain types that are used together in most scenarios. When their applications are mutually exclusive, types should be located in separate namespaces. For example, the <xref:System.Web.UI> namespace contains types that are used in Web applications, and the <xref:System.Windows.Forms> namespace contains types that are used in [!INCLUDE[TLA#tla_mswin](../code-quality/includes/tlasharptla_mswin_md.md)]-based applications. Even though both namespaces have types that control aspects of the user interface, these types are not designed for use in the same application. Therefore, they are located in separate namespaces. Careful namespace organization can also be helpful because it increases the discoverability of a feature. By examining the namespace hierarchy, library consumers should be able to locate the types that implement a feature.
34+
35+
Make sure that each of your namespaces has a logical organization, and that a valid reason exists to put types in a sparsely populated namespace. Namespaces should contain types that are used together in most scenarios. When their applications are mutually exclusive, types should be located in separate namespaces. For example, the <xref:System.Web.UI> namespace contains types that are used in web applications, and the <xref:System.Windows.Forms> namespace contains types that are used in [!INCLUDE[TLA#tla_mswin](../code-quality/includes/tlasharptla_mswin_md.md)]-based applications. Even though both namespaces have types that control aspects of the user interface, these types are not designed for use in the same application. Therefore, they are located in separate namespaces. Careful namespace organization can also be helpful because it increases the discoverability of a feature. By examining the namespace hierarchy, library consumers should be able to locate the types that implement a feature.
3336

3437
> [!NOTE]
35-
> Design-time types and permissions should not be merged into other namespaces to comply with this guideline. These types belong in their own namespaces below your main namespace, and the namespaces should end in `.Design` and `.Permissions`, respectively.
38+
> Design-time types and permissions should not be merged into other namespaces to comply with this guideline. These types belong in their own namespaces below your main namespace, and the namespaces should end in `.Design` and `.Permissions`, respectively.
3639
3740
## How to Fix Violations
38-
To fix a violation of this rule, try to combine namespaces that contain just a few types into a single namespace.
41+
42+
To fix a violation of this rule, try to combine namespaces that contain just a few types into a single namespace.
3943

4044
## When to Suppress Warnings
41-
It is safe to suppress a warning from this rule when the namespace does not contain types that are used with the types in your other namespaces.
45+
46+
It is safe to suppress a warning from this rule when the namespace does not contain types that are used with the types in your other namespaces.

docs/code-quality/ca2001-avoid-calling-problematic-methods.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Avoid making unnecessary and potentially dangerous method calls. A violation of
3939
|<xref:System.GC.Collect%2A?displayProperty=fullName>|Calling GC.Collect can significantly affect application performance and is rarely necessary. For more information, see [Rico Mariani's Performance Tidbits](http://go.microsoft.com/fwlink/?LinkId=169256) blog entry on MSDN.|
4040
|<xref:System.Threading.Thread.Resume%2A?displayProperty=fullName><br /><br /> <xref:System.Threading.Thread.Suspend%2A?displayProperty=fullName>|Thread.Suspend and Thread.Resume have been deprecated because of their unpredictable behavior. Use other classes in the <xref:System.Threading> namespace, such as <xref:System.Threading.Monitor>, <xref:System.Threading.Mutex>, and <xref:System.Threading.Semaphore>, to synchronize threads or protect resources.|
4141
|<xref:System.Runtime.InteropServices.SafeHandle.DangerousGetHandle%2A?displayProperty=fullName>|The DangerousGetHandle method poses a security risk because it can return a handle that is not valid. See the <xref:System.Runtime.InteropServices.SafeHandle.DangerousAddRef%2A> and the <xref:System.Runtime.InteropServices.SafeHandle.DangerousRelease%2A> methods for more information about how to use the DangerousGetHandle method safely.|
42-
|<xref:System.Reflection.Assembly.LoadFrom%2A?displayProperty=fullName><br /><br /> <xref:System.Reflection.Assembly.LoadFile%2A?displayProperty=fullName><br /><br /> <xref:System.Reflection.Assembly.LoadWithPartialName%2A?displayProperty=fullName>|These methods can load assemblies from unexpected locations. For example, see Suzanne Cook's .NET CLR Notes blog posts [LoadFile vs. LoadFrom](http://go.microsoft.com/fwlink/?LinkId=164450) and [Choosing a Binding Context](http://go.microsoft.com/fwlink/?LinkId=164451) on the MSDN Web site for information about methods that load assemblies.|
42+
|<xref:System.Reflection.Assembly.LoadFrom%2A?displayProperty=fullName><br /><br /> <xref:System.Reflection.Assembly.LoadFile%2A?displayProperty=fullName><br /><br /> <xref:System.Reflection.Assembly.LoadWithPartialName%2A?displayProperty=fullName>|These methods can load assemblies from unexpected locations. For example, see Suzanne Cook's .NET CLR Notes blog posts [LoadFile vs. LoadFrom](http://go.microsoft.com/fwlink/?LinkId=164450) and [Choosing a Binding Context](http://go.microsoft.com/fwlink/?LinkId=164451) for information about methods that load assemblies.|
4343
|[CoSetProxyBlanket](http://go.microsoft.com/fwlink/?LinkID=169250) (Ole32)<br /><br /> [CoInitializeSecurity](http://go.microsoft.com/fwlink/?LinkId=169255) (Ole32)|By the time the user code starts executing in a managed process, it is too late to reliably call CoSetProxyBlanket. The common language runtime (CLR) takes initialization actions that may prevent the users P/Invoke from succeeding.<br /><br /> If you do have to call CoSetProxyBlanket for a managed application, we recommend that you start the process by using a native code (C++) executable, call CoSetProxyBlanket in the native code, and then start your managed code application in process. (Be sure to specify a runtime version number.)|
4444

4545
## How to fix violations

docs/code-quality/ca2132-default-constructors-must-be-at-least-as-critical-as-base-type-default-constructors.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ ms.workload:
1414
- "multiple"
1515
---
1616
# CA2132: Default constructors must be at least as critical as base type default constructors
17+
1718
|||
1819
|-|-|
1920
|TypeName|DefaultConstructorsMustHaveConsistentTransparency|
@@ -22,23 +23,26 @@ ms.workload:
2223
|Breaking Change|Breaking|
2324

2425
> [!NOTE]
25-
> This warning is only applied to code that is running the CoreCLR (the version of the CLR that is specific to Silverlight Web applications).
26+
> This warning is only applied to code that is running the CoreCLR (the version of the CLR that is specific to Silverlight web applications).
2627
2728
## Cause
28-
The transparency attribute of the default constructor of a derived class is not as critical as the transparency of the base class.
29+
30+
The transparency attribute of the default constructor of a derived class is not as critical as the transparency of the base class.
2931

3032
## Rule Description
31-
Types and members that have the <xref:System.Security.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 SecurityCritical.
3233

33-
For CoreCLR platform code, if a base type has a public or protected non-transparent default constructor then the derived type must obey the default constructor inheritance rules. The derived type must also have a default constructor and that constructor must be at least as critical default constructor of the base type.
34+
Types and members that have the <xref:System.Security.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 SecurityCritical.
35+
36+
For CoreCLR platform code, if a base type has a public or protected non-transparent default constructor then the derived type must obey the default constructor inheritance rules. The derived type must also have a default constructor and that constructor must be at least as critical default constructor of the base type.
3437

3538
## How to Fix Violations
36-
To fix the violation, remove the type or do not derive from security non-transparent type.
39+
40+
To fix the violation, remove the type or do not derive from security non-transparent type.
3741

3842
## When to Suppress Warnings
39-
Do not suppress warnings from this rule. Violations of this rule by application code will result in the CoreCLR refusing to load the type with a <xref:System.TypeLoadException>.
43+
44+
Do not suppress warnings from this rule. Violations of this rule by application code will result in the CoreCLR refusing to load the type with a <xref:System.TypeLoadException>.
4045

4146
### Code
42-
[!code-csharp[FxCop.Security.CA2132.DefaultConstructorsMustHaveConsistentTransparency#1](../code-quality/codesnippet/CSharp/ca2132-default-constructors-must-be-at-least-as-critical-as-base-type-default-constructors_1.cs)]
4347

44-
### Comments
48+
[!code-csharp[FxCop.Security.CA2132.DefaultConstructorsMustHaveConsistentTransparency#1](../code-quality/codesnippet/CSharp/ca2132-default-constructors-must-be-at-least-as-critical-as-base-type-default-constructors_1.cs)]

docs/code-quality/ca2133-delegates-must-bind-to-methods-with-consistent-transparency.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ ms.workload:
1414
- "multiple"
1515
---
1616
# CA2133: Delegates must bind to methods with consistent transparency
17+
1718
|||
1819
|-|-|
1920
|TypeName|DelegatesMustBindWithConsistentTransparency|
@@ -22,19 +23,24 @@ ms.workload:
2223
|Breaking Change|Breaking|
2324

2425
> [!NOTE]
25-
> This warning is only applied to code that is running the CoreCLR (the version of the CLR that is specific to Silverlight Web applications).
26+
> This warning is only applied to code that is running the CoreCLR (the version of the CLR that is specific to Silverlight web applications).
2627
2728
## Cause
28-
This warning fires on a method that binds a delegate that is marked with the <xref:System.Security.SecurityCriticalAttribute> to a method that is transparent or that is marked with the <xref:System.Security.SecuritySafeCriticalAttribute>. The warning also fires a method that binds a delegate that is transparent or safe-critical to a critical method.
29+
30+
This warning fires on a method that binds a delegate that is marked with the <xref:System.Security.SecurityCriticalAttribute> to a method that is transparent or that is marked with the <xref:System.Security.SecuritySafeCriticalAttribute>. The warning also fires a method that binds a delegate that is transparent or safe-critical to a critical method.
2931

3032
## Rule Description
31-
Delegate types and the methods that they bind to must have consistent transparency. Transparent and safe-critical delegates may only bind to other transparent or safe-critical methods. Similarly, critical delegates may only bind to critical methods. These binding rules ensure that the only code that can invoke a method via a delegate could have also invoked the same method directly. For example, binding rules prevent transparent code from calling critical code directly via a transparent delegate.
33+
34+
Delegate types and the methods that they bind to must have consistent transparency. Transparent and safe-critical delegates may only bind to other transparent or safe-critical methods. Similarly, critical delegates may only bind to critical methods. These binding rules ensure that the only code that can invoke a method via a delegate could have also invoked the same method directly. For example, binding rules prevent transparent code from calling critical code directly via a transparent delegate.
3235

3336
## How to Fix Violations
34-
To fix a violation of this warning, change the transparency of the delegate or of the method that it binds so that the transparency of the two are equivalent.
37+
38+
To fix a violation of this warning, change the transparency of the delegate or of the method that it binds so that the transparency of the two are equivalent.
3539

3640
## When to Suppress Warnings
37-
Do not suppress a warning from this rule.
41+
42+
Do not suppress a warning from this rule.
3843

3944
### Code
40-
[!code-csharp[FxCop.Security.CA2133.DelegatesMustBindWithConsistentTransparency#1](../code-quality/codesnippet/CSharp/ca2133-delegates-must-bind-to-methods-with-consistent-transparency_1.cs)]
45+
46+
[!code-csharp[FxCop.Security.CA2133.DelegatesMustBindWithConsistentTransparency#1](../code-quality/codesnippet/CSharp/ca2133-delegates-must-bind-to-methods-with-consistent-transparency_1.cs)]

docs/code-quality/ca2212-do-not-mark-serviced-components-with-webmethod.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ ms.workload:
1818
- "multiple"
1919
---
2020
# CA2212: Do not mark serviced components with WebMethod
21+
2122
|||
2223
|-|-|
2324
|TypeName|DoNotMarkServicedComponentsWithWebMethod|
@@ -26,17 +27,22 @@ ms.workload:
2627
|Breaking Change|Breaking|
2728

2829
## Cause
29-
A method in a type that inherits from <xref:System.EnterpriseServices.ServicedComponent?displayProperty=fullName> is marked with <xref:System.Web.Services.WebMethodAttribute?displayProperty=fullName>.
30+
31+
A method in a type that inherits from <xref:System.EnterpriseServices.ServicedComponent?displayProperty=fullName> is marked with <xref:System.Web.Services.WebMethodAttribute?displayProperty=fullName>.
3032

3133
## Rule Description
32-
<xref:System.Web.Services.WebMethodAttribute> applies to methods within an XML Web service that were created by using ASP.NET; it makes the method callable from remote Web clients. The method and class must be public and executing in an ASP.NET Web application. <xref:System.EnterpriseServices.ServicedComponent> types are hosted by COM+ applications and can use COM+ services. <xref:System.Web.Services.WebMethodAttribute> is not applied to <xref:System.EnterpriseServices.ServicedComponent> types because they are not intended for the same scenarios. Specifically, adding the attribute to the <xref:System.EnterpriseServices.ServicedComponent> method does not make the method callable from remote Web clients. Because <xref:System.Web.Services.WebMethodAttribute> and a <xref:System.EnterpriseServices.ServicedComponent> method have conflicting behaviors and requirements for context and transaction flow, the behavior of the method will be incorrect in some scenarios.
34+
35+
<xref:System.Web.Services.WebMethodAttribute> applies to methods within an XML web service that were created by using ASP.NET; it makes the method callable from remote web clients. The method and class must be public and executing in an ASP.NET web application. <xref:System.EnterpriseServices.ServicedComponent> types are hosted by COM+ applications and can use COM+ services. <xref:System.Web.Services.WebMethodAttribute> is not applied to <xref:System.EnterpriseServices.ServicedComponent> types because they are not intended for the same scenarios. Specifically, adding the attribute to the <xref:System.EnterpriseServices.ServicedComponent> method does not make the method callable from remote web clients. Because <xref:System.Web.Services.WebMethodAttribute> and a <xref:System.EnterpriseServices.ServicedComponent> method have conflicting behaviors and requirements for context and transaction flow, the behavior of the method will be incorrect in some scenarios.
3336

3437
## How to Fix Violations
35-
To fix a violation of this rule, remove the attribute from the <xref:System.EnterpriseServices.ServicedComponent> method.
38+
39+
To fix a violation of this rule, remove the attribute from the <xref:System.EnterpriseServices.ServicedComponent> method.
3640

3741
## When to Suppress Warnings
38-
Do not suppress a warning from this rule. There are no scenarios where combining these elements is correct.
42+
43+
Do not suppress a warning from this rule. There are no scenarios where combining these elements is correct.
3944

4045
## See Also
41-
<xref:System.EnterpriseServices.ServicedComponent?displayProperty=fullName>
42-
<xref:System.Web.Services.WebMethodAttribute?displayProperty=fullName>
46+
47+
- <xref:System.EnterpriseServices.ServicedComponent?displayProperty=fullName>
48+
- <xref:System.Web.Services.WebMethodAttribute?displayProperty=fullName>

docs/code-quality/code-analysis-policy-errors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The following errors occur if the code analysis policy is not satisfied at check
6262

6363
**You must enable Code Analysis in project {0} properties and build before checking in.**
6464

65-
This error applied to [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)] projects and Web projects. The policy requires managed code analysis to be performed, but it is not enabled in the current project on the client.
65+
This error applied to [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)] projects and web projects. The policy requires managed code analysis to be performed, but it is not enabled in the current project on the client.
6666

6767
**You must enable C/C++ Code Analysis in project {0} properties and build before checking in.**
6868

docs/code-quality/how-to-configure-code-analysis-for-a-managed-code-project.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ms.workload:
2121
In Visual Studio, you can choose from a list of code analysis *rule sets* to apply to a managed code project. The default rule set is *Microsoft Minimum Recommended Rules*. You can apply another rule set to a project or to all projects in a solution.
2222

2323
> [!TIP]
24-
> For information about how to configure a rule set for ASP.NET Web applications, see [How to: Configure Code Analysis for an ASP.NET Web Application](../code-quality/how-to-configure-code-analysis-for-an-aspnet-web-application.md).
24+
> For information about how to configure a rule set for ASP.NET web applications, see [How to: Configure Code Analysis for an ASP.NET web Application](../code-quality/how-to-configure-code-analysis-for-an-aspnet-web-application.md).
2525
2626
## To configure a rule set for a .NET Framework project
2727

@@ -70,4 +70,4 @@ By default, all the managed projects of a solution are assigned the *Microsoft M
7070

7171
## See also
7272

73-
- [How to: Configure Code Analysis for an ASP.NET Web Application](../code-quality/how-to-configure-code-analysis-for-an-aspnet-web-application.md)
73+
- [How to: Configure Code Analysis for an ASP.NET web Application](../code-quality/how-to-configure-code-analysis-for-an-aspnet-web-application.md)

0 commit comments

Comments
 (0)