Skip to content

Commit fe7d2c6

Browse files
committed
Merge branch 'master' of https://github.com/microsoft/visualstudio-docs-pr into 1235779-2
2 parents 5e7a8c8 + 1a39319 commit fe7d2c6

File tree

90 files changed

+1363
-1082
lines changed

Some content is hidden

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

90 files changed

+1363
-1082
lines changed

.openpublishing.redirection.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,6 @@
130130
"redirect_url": "/visualstudio/code-quality/code-analysis-for-managed-code-overview",
131131
"redirect_document_id": false
132132
},
133-
{
134-
"source_path": "docs/code-quality/index.md",
135-
"redirect_url": "/visualstudio/code-quality/code-analysis-for-managed-code-overview",
136-
"redirect_document_id": false
137-
},
138133
{
139134
"source_path": "docs/code-quality/measuring-complexity-and-maintainability-of-managed-code.md",
140135
"redirect_url": "/visualstudio/code-quality/code-metrics-values/",

docs/code-quality/ca1063-implement-idisposable-correctly.md

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ ms.assetid: 12afb1ea-3a17-4a3f-a1f0-fcdb853e2359
1414
author: gewarren
1515
ms.author: gewarren
1616
manager: douge
17+
dev_langs:
18+
- "CSharp"
1719
ms.workload:
1820
- "multiple"
1921
---
@@ -28,51 +30,51 @@ ms.workload:
2830

2931
## Cause
3032

31-
`IDisposable` is not implemented correctly. Some reasons for this problem are listed here:
33+
The <xref:System.IDisposable?displayProperty=nameWithType> interface is not implemented correctly. Possible reasons for this include:
3234

33-
- IDisposable is re-implemented in the class.
35+
- <xref:System.IDisposable> is reimplemented in the class.
3436

35-
- Finalize is re-overridden.
37+
- Finalize is reoverridden.
3638

37-
- Dispose is overridden.
39+
- Dispose() is overridden.
3840

39-
- Dispose() is not public, sealed, or named Dispose.
41+
- The Dispose() method is not public, [sealed](/dotnet/csharp/language-reference/keywords/sealed), or named **Dispose**.
4042

4143
- Dispose(bool) is not protected, virtual, or unsealed.
4244

4345
- In unsealed types, Dispose() must call Dispose(true).
4446

45-
- For unsealed types, the Finalize implementation does not call either or both Dispose(bool) or the case class finalizer.
47+
- For unsealed types, the Finalize implementation does not call either or both Dispose(bool) or the base class finalizer.
4648

47-
Violation of any one of these patterns will trigger this warning.
49+
Violation of any one of these patterns triggers warning CA1063.
4850

49-
Every unsealed type that declares and implements the IDisposable interface must provide its own protected virtual void Dispose(bool) method. Dispose() should call Dipose(true) and Finalize should call Dispose(false). If you are creating an unsealed type that declares and implements the IDisposable interface, you must define Dispose(bool) and call it. For more information, see [Cleaning up unmanaged resources](/dotnet/standard/garbage-collection/unmanaged) in the [.NET Framework design guidelines](/dotnet/standard/design-guidelines/index).
51+
Every unsealed type that declares and implements the <xref:System.IDisposable> interface must provide its own protected virtual void Dispose(bool) method. Dispose() should call Dipose(true), and the finalizer should call Dispose(false). If you create an unsealed type that declares and implements the <xref:System.IDisposable> interface, you must define Dispose(bool) and call it. For more information, see [Clean up unmanaged resources (.NET guide)](/dotnet/standard/garbage-collection/unmanaged) and [Dispose pattern](/dotnet/standard/design-guidelines/dispose-pattern).
5052

5153
## Rule description
5254

53-
All IDisposable types should implement the Dispose pattern correctly.
55+
All <xref:System.IDisposable> types should implement the [Dispose pattern](/dotnet/standard/design-guidelines/dispose-pattern) correctly.
5456

5557
## How to fix violations
5658

57-
Examine your code and determine which of the following resolutions will fix this violation.
59+
Examine your code and determine which of the following resolutions will fix this violation:
5860

59-
- Remove IDisposable from the list of interfaces that are implemented by {0} and override the base class Dispose implementation instead.
61+
- Remove <xref:System.IDisposable> from the list of interfaces that are implemented by your type, and override the base class Dispose implementation instead.
6062

61-
- Remove the finalizer from type {0}, override Dispose(bool disposing), and put the finalization logic in the code path where 'disposing' is false.
63+
- Remove the finalizer from your type, override Dispose(bool disposing), and put the finalization logic in the code path where 'disposing' is false.
6264

63-
- Remove {0}, override Dispose(bool disposing), and put the dispose logic in the code path where 'disposing' is true.
65+
- Override Dispose(bool disposing), and put the dispose logic in the code path where 'disposing' is true.
6466

65-
- Ensure that {0} is declared as public and sealed.
67+
- Make sure that Dispose() is declared as public and [sealed](/dotnet/csharp/language-reference/keywords/sealed).
6668

67-
- Rename {0} to 'Dispose' and make sure that it is declared as public and sealed.
69+
- Rename your dispose method to **Dispose** and make sure that it's declared as public and [sealed](/dotnet/csharp/language-reference/keywords/sealed).
6870

69-
- Make sure that {0} is declared as protected, virtual, and unsealed.
71+
- Make sure that Dispose(bool) is declared as protected, virtual, and unsealed.
7072

71-
- Modify {0} so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in [!INCLUDE[vbprvb](../code-quality/includes/vbprvb_md.md)]), and then returns.
73+
- Modify Dispose() so that it calls Dispose(true), then calls <xref:System.GC.SuppressFinalize%2A> on the current object instance (`this`, or `Me` in Visual Basic), and then returns.
7274

73-
- Modify {0} so that it calls Dispose(false) and then returns.
75+
- Modify your finalizer so that it calls Dispose(false) and then returns.
7476

75-
- If you are creating an unsealed type that declares and implements the IDisposable interface, make sure that the implementation of IDisposable follows the pattern that is described earlier in this section.
77+
- If you create an unsealed type that declares and implements the <xref:System.IDisposable> interface, make sure that the implementation of <xref:System.IDisposable> follows the pattern that is described earlier in this section.
7678

7779
## When to suppress warnings
7880

@@ -96,7 +98,7 @@ public class Resource : IDisposable
9698
}
9799

98100
// NOTE: Leave out the finalizer altogether if this class doesn't
99-
// own unmanaged resources itself, but leave the other methods
101+
// own unmanaged resources, but leave the other methods
100102
// exactly as they are.
101103
~Resource()
102104
{
@@ -124,4 +126,9 @@ public class Resource : IDisposable
124126
}
125127
}
126128
}
127-
```
129+
```
130+
131+
## See also
132+
133+
- [Dispose pattern (framework design guidelines)](/dotnet/standard/design-guidelines/dispose-pattern)
134+
- [Clean up unmanaged resources (.NET guide)](/dotnet/standard/garbage-collection/unmanaged)

docs/code-quality/index.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
---
2+
layout: LandingPage
3+
title: Code analysis
4+
description: Learn how to use Visual Studio 2017 to analyze code quality.
5+
ms.prod: visual-studio-dev15
6+
ms.technology: vs-ide-code-analysis
7+
ms.topic: landing-page
8+
ms.author: gewarren
9+
author: gewarren
10+
manager: douge
11+
---
12+
# Code analysis in Visual Studio
13+
14+
Visual Studio provides several different tools to analyze and improve code quality.
15+
16+
<br />
17+
18+
<ul class="panelContent cardsFTitle">
19+
<li>
20+
<a href="code-analysis-for-managed-code-overview.md">
21+
<div class="cardSize">
22+
<div class="cardPadding">
23+
<div class="card">
24+
<div class="cardImageOuter">
25+
<div class="cardImage">
26+
<img src="https://docs.microsoft.com/media/common/i_code-quality.svg" alt="Code quality icon">
27+
</div>
28+
</div>
29+
<div class="cardText">
30+
<h3>Analyze managed code quality</h3>
31+
</div>
32+
</div>
33+
</div>
34+
</div>
35+
</a>
36+
</li>
37+
<li>
38+
<a href="code-analysis-for-c-cpp-overview.md">
39+
<div class="cardSize">
40+
<div class="cardPadding">
41+
<div class="card">
42+
<div class="cardImageOuter">
43+
<div class="cardImage">
44+
<img src="https://docs.microsoft.com/media/logos/logo_Cplusplus.svg" alt="C++ logo">
45+
</div>
46+
</div>
47+
<div class="cardText">
48+
<h3>Analyze C and C++ code quality</h3>
49+
</div>
50+
</div>
51+
</div>
52+
</div>
53+
</a>
54+
</li>
55+
<li>
56+
<a href="code-metrics-values.md">
57+
<div class="cardSize">
58+
<div class="cardPadding">
59+
<div class="card">
60+
<div class="cardImageOuter">
61+
<div class="cardImage">
62+
<img src="https://docs.microsoft.com/media/common/i_data-collection.svg" alt="Data collection icon">
63+
</div>
64+
</div>
65+
<div class="cardText">
66+
<h3>Measure code maintainability with code metrics</h3>
67+
</div>
68+
</div>
69+
</div>
70+
</div>
71+
</a>
72+
</li>
73+
</ul>
74+
75+
<hr>
76+
<h2>Reference</h2>
77+
78+
<ul class="panelContent cardsW">
79+
<li>
80+
<a href="https://docs.microsoft.com/visualstudio/code-quality/code-analysis-for-managed-code-warnings">
81+
<div class="cardSize">
82+
<div class="cardPadding">
83+
<div class="card">
84+
<div class="cardText">
85+
<h3>Managed code analysis warnings</h3>
86+
</div>
87+
</div>
88+
</div>
89+
</div>
90+
</a>
91+
</li>
92+
<li>
93+
<a href="https://docs.microsoft.com/visualstudio/code-quality/code-analysis-for-c-cpp-warnings">
94+
<div class="cardSize">
95+
<div class="cardPadding">
96+
<div class="card">
97+
<div class="cardText">
98+
<h3>C++ code analysis warnings</h3>
99+
</div>
100+
</div>
101+
</div>
102+
</div>
103+
</a>
104+
</li>
105+
<li>
106+
<a href="https://docs.microsoft.com/visualstudio/code-quality/rule-set-reference">
107+
<div class="cardSize">
108+
<div class="cardPadding">
109+
<div class="card">
110+
<div class="cardText">
111+
<h3>Rule sets</h3>
112+
</div>
113+
</div>
114+
</div>
115+
</div>
116+
</a>
117+
</li>
118+
</ul>

docs/code-quality/toc.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
1+
- name: Code analysis documentation
2+
href: index.md
13
- name: Overview
24
items:
3-
- name: Code Analysis for Managed Code
5+
- name: Code analysis for managed code
46
href: code-analysis-for-managed-code-overview.md
5-
- name: Roslyn Analyzers
7+
- name: Roslyn analyzers
68
href: roslyn-analyzers-overview.md
7-
- name: Code Analysis for C/C++
9+
- name: Code analysis for C/C++
810
href: code-analysis-for-c-cpp-overview.md
9-
- name: Measure Code Maintainability with Code Metrics
11+
- name: Measure code maintainability with code metrics
1012
href: code-metrics-values.md
1113
- name: Quickstarts
1214
items:
13-
- name: "Quickstart: Code Analysis for C/C++"
15+
- name: "Quickstart: Code analysis for C/C++"
1416
href: quick-start-code-analysis-for-c-cpp.md
1517
- name: Tutorials
1618
items:
17-
- name: Analyze Managed Code for Code Defects
19+
- name: Analyze managed code for code defects
1820
href: walkthrough-analyzing-managed-code-for-code-defects.md
19-
- name: Analyze C/C++ Code for Defects
21+
- name: Analyze C/C++ code for defects
2022
href: walkthrough-analyzing-c-cpp-code-for-defects.md
2123
items:
22-
- name: Demo Sample
24+
- name: Demo sample
2325
href: demo-sample.md
2426
- name: How-to guides
2527
items:
26-
- name: Code Analysis for Managed Code
28+
- name: Code analysis for managed code
2729
items:
2830
- name: Install Roslyn Analyzers
2931
href: install-roslyn-analyzers.md
@@ -48,7 +50,7 @@
4850
href: anonymous-methods-and-code-analysis.md
4951
- name: Create a Work Item for a Managed Code Defect
5052
href: how-to-create-a-work-item-for-a-managed-code-defect.md
51-
- name: Code Analysis for C/C++
53+
- name: Code analysis for C/C++
5254
items:
5355
- name: Use the C++ Core Guidelines checkers
5456
href: using-the-cpp-core-guidelines-checkers.md
@@ -75,7 +77,7 @@
7577
href: best-practices-and-examples-sal.md
7678
- name: Specify Additional Code Information by Using _Analysis_assume
7779
href: how-to-specify-additional-code-information-by-using-analysis-assume.md
78-
- name: Rule Sets
80+
- name: Rule sets
7981
href: using-rule-sets-to-group-code-analysis-rules.md
8082
items:
8183
- name: Rule Sets for Managed Code
@@ -89,7 +91,7 @@
8991
href: how-to-create-a-custom-rule-set.md
9092
- name: Use the Rule Set Editor
9193
href: working-in-the-code-analysis-rule-set-editor.md
92-
- name: Check-in Policies
94+
- name: Check-in policies
9395
href: how-to-create-or-update-standard-code-analysis-check-in-policies.md
9496
items:
9597
- name: Implement Custom Code Analysis Check-in Policies for Managed Code
@@ -100,7 +102,7 @@
100102
href: how-to-synchronize-code-project-rule-sets-with-team-project-check-in-policy.md
101103
- name: Version Compatibility
102104
href: version-compatibility-for-code-analysis-check-in-policies.md
103-
- name: Code Metrics
105+
- name: Code metrics
104106
items:
105107
- name: Generate Code Metrics Data
106108
href: how-to-generate-code-metrics-data.md
@@ -137,7 +139,7 @@
137139
href: native-recommended-rules-rule-set.md
138140
- name: Security Rules rule set for managed code
139141
href: security-rules-rule-set-for-managed-code.md
140-
- name: Code Analysis for Managed Code Warnings
142+
- name: Code analysis for managed code warnings
141143
href: code-analysis-for-managed-code-warnings.md
142144
items:
143145
- name: Code Analysis Warnings for Managed Code by CheckId
@@ -149,7 +151,7 @@
149151
href: ca5350-do-not-use-weak-cryptographic-algorithms.md
150152
- name: "CA5351 Do Not Use Broken Cryptographic Algorithms"
151153
href: ca5351-do-not-use-broken-cryptographic-algorithms.md
152-
- name: Design Warnings
154+
- name: Design warnings
153155
href: design-warnings.md
154156
items:
155157
- name: "CA1000: Do not declare static members on generic types"

docs/data-tools/toc.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
- name: Overview
2-
items:
3-
- name: Access data in Visual Studio
4-
href: accessing-data-in-visual-studio.md
2+
href: accessing-data-in-visual-studio.md
53
- name: Tutorials
64
items:
75
- name: Create a simple data app by using ADO.NET

docs/deployment/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ layout: LandingPage
33
title: Deploying your Apps in Visual Studio | Microsoft Docs
44
description: Learn how use Visual Studio 2017 to deploy applications, services, and components.
55
ms.topic: landing-page
6+
ms.prod: visual-studio-dev15
67
ms.technology: vs-ide-deployment
78
ms.author: "mikejo"
89
author: "mikejo5000"
@@ -44,7 +45,7 @@ Visual Studio provides several different tools to help you deploy your apps.
4445
</div>
4546
</div>
4647
<div class="cardText">
47-
<h3>Deploy to a Local Folder</h3>
48+
<h3>Deploy to a local folder</h3>
4849
</div>
4950
</div>
5051
</div>
@@ -62,7 +63,7 @@ Visual Studio provides several different tools to help you deploy your apps.
6263
</div>
6364
</div>
6465
<div class="cardText">
65-
<h3>Deploy to a Website or Network Share</h3>
66+
<h3>Deploy to a website or network share</h3>
6667
</div>
6768
</div>
6869
</div>

docs/extensibility/about-file-name-extensions.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ manager: douge
1515
ms.workload:
1616
- "vssdk"
1717
---
18-
# About File Name Extensions
18+
# About file name extensions
1919
When you register a file extension of a VSPackage, you associate it with a version of [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)]. This is important if more than one version of [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)] is installed on a computer.
2020

21-
File extensions for VSPackages are registered under HKEY_CLASSES_ROOT key with a default value that points to the associated programmatic identifier (ProgID).
21+
File extensions for VSPackages are registered under **HKEY_CLASSES_ROOT** key with a default value that points to the associated programmatic identifier (ProgID).
2222

23-
The following is an example of the registration information for the .vcproj file extension:
23+
The following example shows registration information for the *.vcproj* file extension:
2424

2525
```
2626
HKEY_CLASSES_ROOT\
2727
.vcproj\
2828
(default)=" VisualStudio.vcproj.8.0"
2929
```
3030

31-
Files associated with [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)] must have a versioned ProgID, such as `VisualStudio.vcproj.8.0`, to allow side-by-side installations of the product to maintain file extension associations among product versions. A version-specific ProgID also allows you to use standard verbs, such as open, edit, and so on, without the concern of overwriting or being overwritten by other applications or versions of [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)].
31+
Files associated with [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)] must have a versioned ProgID, such as `VisualStudio.vcproj.8.0`. A versioned ProgID allows side-by-side installations of the product to maintain file extension associations among product versions. A version-specific ProgID also allows you to use standard verbs, such as open, edit, and so on, without the concern of overwriting or being overwritten by other applications or versions of [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)].
3232

33-
In certain cases, the ProgID associated with a file extension should not be changed. For example, the ProgID for the .htm file extension (progid = htmlfile) is hard coded in a number of places in the operating system, and is widely known and used in association with .htm and .html files.
33+
In certain cases, the ProgID associated with a file extension should not be changed. For example, the ProgID for the *.htm* file extension (progid = htmlfile) is hard-coded in a number of places in the operating system, and is widely known and used in association with *.htm* and *.html* files.
3434

35-
## See Also
36-
[Registering File Name Extensions for Side-By-Side Deployments](../extensibility/registering-file-name-extensions-for-side-by-side-deployments.md)
37-
[Specifying File Handlers for File Name Extensions](../extensibility/specifying-file-handlers-for-file-name-extensions.md)
35+
## See also
36+
[Register file name extensions for side-by-side deployments](../extensibility/registering-file-name-extensions-for-side-by-side-deployments.md)
37+
[Specify file handlers for file name extensions](../extensibility/specifying-file-handlers-for-file-name-extensions.md)

0 commit comments

Comments
 (0)