Skip to content

Commit a6e669a

Browse files
authored
Merge pull request #4921 from MicrosoftDocs/master637194791719047190
For protected CLA branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents 2da0c5e + 1013718 commit a6e669a

15 files changed

+197
-19
lines changed

docs/code-quality/ca1712.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,26 @@ The following example shows an incorrectly named enumeration followed by the cor
5656

5757
[CA2217: Do not mark enums with FlagsAttribute](../code-quality/ca2217.md)
5858

59+
## Configurability
60+
61+
If you're running this rule from [FxCop analyzers](install-fxcop-analyzers.md) (and not with legacy analysis), you can configure the analysis for this rule.
62+
63+
You can configure the number of enumeration values required to trigger the rule. For example, to specify that the rule is triggered if one or more the enum values starts with the enum type name, add the following key-value pair to an *.editorconfig* file in your project:
64+
65+
```ini
66+
dotnet_code_quality.CA1712.enum_values_prefix_trigger = AnyEnumValue
67+
```
68+
69+
Examples:
70+
71+
| Option value | Summary |
72+
| --- | --- |
73+
|`dotnet_code_quality.CA1712.enum_values_prefix_trigger = AnyEnumValue` | The rule is triggered if *any* of the enum values starts with the enum type name.
74+
|`dotnet_code_quality.CA1712.enum_values_prefix_trigger = AllEnumValues` | The rule is triggered if *all* of the enum values start with the enum type name.
75+
|`dotnet_code_quality.CA1712.enum_values_prefix_trigger = Heuristic` | The rule is triggered using the default FxCop heuristic (that is, when at least 75% of the enum values start with the enum type name).
76+
77+
You can configure all of these options for just this rule, for all rules, or for all rules in this category (Naming). For more information, see [Configure FxCop analyzers](configure-fxcop-analyzers.md).
78+
5979
## See also
6080

6181
- <xref:System.Enum?displayProperty=fullName>

docs/deployment/clickonce-and-authenticode.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ ms.workload:
5656

5757
- Uninstall the application, and reinstall a new version with a valid certificate.
5858

59-
- Create a command-line assembly that updates the certificate. Step-by-step information about this process can be found at [Microsoft Support Article 925521](https://support.microsoft.com/help/925521).
60-
6159
### Store certificates
6260

6361
- You can store certificates as a *.pfx* file on your file system, or you can store them inside of a key container. A user on a Windows domain can have a number of key containers. By default, *MakeCert.exe* will store certificates in your personal key container, unless you specify that it should save it to a *.pfx* instead. *Mage.exe* and *MageUI.exe*, the [!INCLUDE[winsdkshort](../debugger/debug-interface-access/includes/winsdkshort_md.md)] tools for creating [!INCLUDE[ndptecclick](../deployment/includes/ndptecclick_md.md)] deployments, enable you to use certificates stored in either fashion.

docs/install/visual-studio-build-numbers-and-release-dates.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: A list of released versions and build numbers for Visual Studio, so
55
author: ornellaalt
66
ms.author: ornella
77
manager: jillfra
8-
ms.date: 03/02/2020
8+
ms.date: 03/10/2020
99
ms.topic: reference
1010
ms.workload:
1111
- multiple
@@ -22,6 +22,8 @@ The following table lists the build numbers and release dates for Visual Studio
2222

2323
| **Version**| **Channel** | **Release date** | **Build version** |
2424
| ---------------------- | ----------- | ---------------- | ----------------- |
25+
| 16.4.6 | Release | March 10, 2020 | 16.4.29905.134 |
26+
| 16.0.12 | Release | March 10, 2020 | 16.0.28803.697 |
2527
| 16.5.0 | Preview 5 | March 2, 2020 | 16.5.29827.131 |
2628
| 16.5.0 | Preview 4 | February 25, 2020 | 16.5.29820.132 |
2729
| 16.5.0 | Preview 3 | February 19, 2020 | 16.5.29814.53 |
@@ -120,6 +122,7 @@ The following table lists the build numbers and release dates for Visual Studio
120122

121123
| **Version**| **Channel** | **Release date** | **Build version** |
122124
| ---------------------- | ----------- | ---------------- | ----------------- |
125+
| 15.9.21 | Release | March 10, 2020 | 15.9.28307.1064 |
123126
| 15.9.20 | Release | February 11, 2020 | 15.9.28307.1033 |
124127
| 15.9.19 | Release | January 14, 2020 | 15.9.28307.1000 |
125128
| 15.0.28 | Release | December 11, 2019 | 15.0.26228.102 |

docs/msbuild/calltarget-task.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ Invokes the specified targets within the project file.
3838

3939
If you want to build the default targets, use the [MSBuild task](../msbuild/msbuild-task.md) and set the `Projects` parameter equal to `$(MSBuildProjectFile)`.
4040

41+
When using `CallTarget`, MSBuild evaluates the called target in a new scope, as opposed to the same scope it's called from. This means that any item and property changes in the called target are not visible to the calling target. To pass information to the calling target, use the `TargetOutputs` output parameter.
42+
4143
In addition to the parameters listed above, this task inherits parameters from the <xref:Microsoft.Build.Tasks.TaskExtension> class, which itself inherits from the <xref:Microsoft.Build.Utilities.Task> class. For a list of these additional parameters and their descriptions, see [TaskExtension base class](../msbuild/taskextension-base-class.md).
4244

4345
## Example

docs/msbuild/how-to-extend-the-visual-studio-build-process.md

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ The Visual Studio build process is defined by a series of MSBuild *.targets* fil
2222
- Overriding specific predefined targets defined in the common targets (*Microsoft.Common.targets* or the files that it imports).
2323

2424
- Overriding the "DependsOn" properties defined in the common targets.
25-
## Override predefined targets
2625

2726
## Override predefined targets
2827

@@ -64,6 +63,45 @@ The following table shows all of the targets in the common targets that you can
6463
|`BeforeResolveReferences`, `AfterResolveReferences`|Tasks that are inserted in one of these targets run before or after assembly references are resolved.|
6564
|`BeforeResGen`, `AfterResGen`|Tasks that are inserted in one of these targets run before or after resources are generated.|
6665

66+
## Example: AfterTargets and BeforeTargets
67+
68+
The following example shows how to use the `AfterTargets` attribute to add a custom target that does something with the output files. In this case, it copies the output files to a new folder *CustomOutput*. The example also shows how to clean up the files created by the custom build operation with a `CustomClean` target by using a `BeforeTargets` attribute and specifying that the custom clean operation runs before the `CoreClean` target.
69+
70+
```xml
71+
<Project Sdk="Microsoft.NET.Sdk">
72+
73+
<PropertyGroup>
74+
<TargetFramework>netcoreapp3.1</TargetFramework>
75+
<_OutputCopyLocation>$(OutputPath)..\..\CustomOutput\</_OutputCopyLocation>
76+
</PropertyGroup>
77+
78+
<Target Name="CustomAfterBuild" AfterTargets="Build">
79+
<ItemGroup>
80+
<_FilesToCopy Include="$(OutputPath)**\*"/>
81+
</ItemGroup>
82+
<Message Text="_FilesToCopy: @(_FilesToCopy)" Importance="high"/>
83+
84+
<Message Text="DestFiles:
85+
@(_FilesToCopy->'$(_OutputCopyLocation)%(RecursiveDir)%(Filename)%(Extension)')"/>
86+
87+
<Copy SourceFiles="@(_FilesToCopy)"
88+
DestinationFiles=
89+
"@(_FilesToCopy->'$(_OutputCopyLocation)%(RecursiveDir)%(Filename)%(Extension)')"/>
90+
</Target>
91+
92+
<Target Name="CustomClean" BeforeTargets="CoreClean">
93+
<Message Text="Inside Custom Clean" Importance="high"/>
94+
<ItemGroup>
95+
<_CustomFilesToDelete Include="$(_OutputCopyLocation)**\*"/>
96+
</ItemGroup>
97+
<Delete Files='@(_CustomFilesToDelete)'/>
98+
</Target>
99+
</Project>
100+
```
101+
102+
> [!WARNING]
103+
> Be sure to use different names than the predefined targets listed in the table in the previous section (for example, we named the custom build target here `CustomAfterBuild`, not `AfterBuild`), since those predefined targets are overridden by the SDK import which also defines them. You don't see the import of the target file that overrides those targets, but it is implicitly added to the end of the project file when you use the `Sdk` attribute method of referencing an SDK.
104+
67105
## Override DependsOn properties
68106

69107
Overriding predefined targets is an easy way to extend the build process, but, because MSBuild evaluates the definition of targets sequentially, there is no way to prevent another project that imports your project from overriding the targets you already have overridden. So, for example, the last `AfterBuild` target defined in the project file, after all other projects have been imported, will be the one that is used during the build.
@@ -125,6 +163,60 @@ Projects that import your project files can override these properties without ov
125163
|`CleanDependsOn`|The property to override if you want to clean up output from your custom build process.|
126164
|`CompileDependsOn`|The property to override if you want to insert custom processes before or after the compilation step.|
127165

166+
## Example: BuildDependsOn and CleanDependsOn
167+
168+
The following example is similar to the `BeforeTargets` and `AfterTargets` example, but shows how to achieve similar functionality. It extends the build by using `BuildDependsOn` to add your own task `CustomAfterBuild` that copies the output files after the build, and also adds the corresponding `CustomClean` task by using `CleanDependsOn`.
169+
170+
In this example, this is an SDK-style project. As mentioned in the note about SDK-style projects earlier in this article, you must use the manual import method instead of the `Sdk` attribute that Visual Studio uses when it generates project files.
171+
172+
```xml
173+
<Project>
174+
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
175+
176+
<PropertyGroup>
177+
<TargetFramework>netcoreapp3.1</TargetFramework>
178+
</PropertyGroup>
179+
180+
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
181+
182+
<PropertyGroup>
183+
<BuildDependsOn>
184+
$(BuildDependsOn);CustomAfterBuild
185+
</BuildDependsOn>
186+
187+
<CleanDependsOn>
188+
$(CleanDependsOn);CustomClean
189+
</CleanDependsOn>
190+
191+
<_OutputCopyLocation>$(OutputPath)..\..\CustomOutput\</_OutputCopyLocation>
192+
</PropertyGroup>
193+
194+
<Target Name="CustomAfterBuild">
195+
<ItemGroup>
196+
<_FilesToCopy Include="$(OutputPath)**\*"/>
197+
</ItemGroup>
198+
<Message Text="_FilesToCopy: @(_FilesToCopy)" Importance="high"/>
199+
200+
<Message Text="DestFiles:
201+
@(_FilesToCopy->'$(_OutputCopyLocation)%(RecursiveDir)%(Filename)%(Extension)')"/>
202+
203+
<Copy SourceFiles="@(_FilesToCopy)"
204+
DestinationFiles=
205+
"@(_FilesToCopy->'$(_OutputCopyLocation)%(RecursiveDir)%(Filename)%(Extension)')"/>
206+
</Target>
207+
208+
<Target Name="CustomClean">
209+
<Message Text="Inside Custom Clean" Importance="high"/>
210+
<ItemGroup>
211+
<_CustomFilesToDelete Include="$(_OutputCopyLocation)**\*"/>
212+
</ItemGroup>
213+
<Delete Files='@(_CustomFilesToDelete)'/>
214+
</Target>
215+
</Project>
216+
```
217+
218+
The order of elements is important. The `BuildDependsOn` and `CleanDependsOn` elements must appear after importing the standard SDK targets file.
219+
128220
## See also
129221

130222
- [Visual Studio integration](../msbuild/visual-studio-integration-msbuild.md)

docs/msbuild/import-element-msbuild.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Imports the contents of one project file into another project file.
6262

6363
By convention, shared imported project files are saved as *.targets* files, but they are standard MSBuild project files. MSBuild does not prevent you from importing a project that has a different file name extension, but we recommend that you use the *.targets* extension for consistency.
6464

65-
Relative paths in imported projects are interpreted relative to the directory of the importing project. Therefore, if a project file is imported into several project files in different locations, the relative paths in the imported project file will be interpreted differently for each imported project.
65+
Relative paths in imported projects are interpreted relative to the directory of the importing project (with a few exceptions described later in this paragraph). Therefore, if a project file is imported into several project files in different locations, the relative paths in the imported project file will be interpreted differently for each imported project. There are two exceptions. One exception is that in `Import` elements, the path is always interpreted relative to the project that contains the `Import` element. Another exception is that the `UsingTask` always interprets the relative path for the `AssemblyFile` attribute relative to the file that contains the `UsingTask` element.
6666

6767
All MSBuild reserved properties that relate to the project file, for example, `MSBuildProjectDirectory` and `MSBuildProjectFile`, that are referenced in an imported project are assigned values based on the importing project file.
6868

docs/msbuild/msbuild-items.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ MSBuild items are inputs into the build system, and they typically represent fil
3939
</ItemGroup>
4040
```
4141

42+
The `Include` attribute is a path that is interpreted relative to the project file's folder, $(MSBuildProjectPath), even if the item is in an imported file such as a *.targets* file.
43+
4244
## Create items during execution
4345

4446
Items that are outside [Target](../msbuild/target-element-msbuild.md) elements are assigned values during the evaluation phase of a build. During the subsequent execution phase, items can be created or modified in the following ways:

docs/msbuild/signfile-task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Signs the specified file using the specified certificate.
4545

4646
## Example
4747

48-
The following example uses the `SignFile` task to sign the files specified in the `FilesToSign` item collection with the certificate specified by the `Certificate` property.
48+
The following example uses the `SignFile` task to sign the files specified in the `FilesToSign` item collection with the certificate specified by the `CertificateThumbprint` property.
4949

5050
```xml
5151
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

docs/msbuild/xmlpeek-task.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,37 @@ Returns values as specified by XPath Query from an XML file.
3737

3838
In addition to having the parameters that are listed in the table, this task inherits parameters from the <xref:Microsoft.Build.Tasks.TaskExtension> class, which itself inherits from the <xref:Microsoft.Build.Utilities.Task> class. For a list of these additional parameters and their descriptions, see [TaskExtension base class](../msbuild/taskextension-base-class.md).
3939

40+
41+
42+
## Example
43+
44+
Here is a sample XML file `settings.config` to read:
45+
46+
```xml
47+
<appSettings>
48+
<add key="ProjectFolder" value="S1" />
49+
</appSettings>
50+
```
51+
52+
In this example, if you want to read `value`, then use code like the following:
53+
54+
```xml
55+
<Target Name="BeforeBuild">
56+
<XmlPeek XmlInputPath="settings.config" Query="appSettings/add[@key='ProjectFolder']/@value">
57+
<Output TaskParameter="Result" ItemName="value" />
58+
</XmlPeek>
59+
<Message Text="Using project folder @(value)." Importance="high" />
60+
<PropertyGroup>
61+
<ProjectFolder>@(value)</ProjectFolder>
62+
</PropertyGroup>
63+
<ItemGroup>
64+
<Compile Include="Projects\$(ProjectFolder)\Controls\Control1.ascx.cs">
65+
<SubType>ASPXCodeBehind</SubType>
66+
</Compile>
67+
</ItemGroup>
68+
</Target>
69+
```
70+
4071
## See also
4172

4273
- [Tasks](../msbuild/msbuild-tasks.md)

docs/msbuild/xsltransformation-task.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Transforms an XML input by using an XSLT or compiled XSLT and outputs to an outp
2828
|Parameter|Description|
2929
|---------------|-----------------|
3030
|`OutputPaths`|Required <xref:Microsoft.Build.Framework.ITaskItem>`[]` parameter.<br /><br /> Specifies the output files for the XML transformation.|
31-
|`Parameters`|Optional `String` parameter.<br /><br /> Specifies the parameters to the XSLT Input document.|
31+
|`Parameters`|Optional `String` parameter.<br /><br /> Specifies the parameters to the XSLT Input document. Provide the raw XML that holds each parameter as `<Parameter Name="" Value="" Namespace="" />`.|
3232
|`XmlContent`|Optional `String` parameter.<br /><br /> Specifies the XML input as a string.|
3333
|`XmlInputPaths`|Optional <xref:Microsoft.Build.Framework.ITaskItem>`[]` parameter.<br /><br /> Specifies the XML input files.|
3434
|`XslCompiledDllPath`|Optional <xref:Microsoft.Build.Framework.ITaskItem> parameter.<br /><br /> Specifies the compiled XSLT.|
@@ -39,7 +39,19 @@ Transforms an XML input by using an XSLT or compiled XSLT and outputs to an outp
3939

4040
In addition to having the parameters that are listed in the table, this task inherits parameters from the <xref:Microsoft.Build.Tasks.TaskExtension> class, which itself inherits from the <xref:Microsoft.Build.Utilities.Task> class. For a list of these additional parameters and their descriptions, see [TaskExtension base class](../msbuild/taskextension-base-class.md).
4141

42+
## Example
43+
44+
In the following example, an XSL transform file *transform.xslt* is used to modify the xml file `$(XmlInputFileName)`. The transformed XML is written to `$(IntermediateOutputPath)output.xml`. The XSL transform takes `$(Parameter1)` as an input parameter.
45+
46+
```xml
47+
<XslTransformation XslInputPath="transform.xslt"
48+
XmlInputPaths="$(XmlInputFileName)"
49+
OutputPaths="$(IntermediateOutputPath)output.xml"
50+
Parameters="&lt;Parameter Name='Parameter1' Value='$(Parameter1)'/&gt;"/>
51+
```
52+
4253
## See also
4354

55+
- [XSLT Parameters](/dotnet/standard/data/xml/xslt-parameters)
4456
- [Tasks](../msbuild/msbuild-tasks.md)
4557
- [Task reference](../msbuild/msbuild-task-reference.md)

docs/msbuild/zipdirectory-task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Creates a *.zip* archive from the contents of a directory.
4646

4747
## Example
4848

49-
The following example creates a *.zip* archive from the output directory after building a project.
49+
The following example (if used as an imported *.targets* file) creates a *.zip* archive from the output directory after building a project. The `$(OutputPath)` property would normally be defined in an MSBuild project file, so a project file that imports the following file would produce a zip archive `output.zip`:
5050

5151
```xml
5252
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

docs/test/run-a-unit-test-as-a-64-bit-process.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Run a unit test as a 64-bit process
3-
ms.date: 11/04/2016
3+
ms.date: 03/10/2020
44
ms.topic: conceptual
55
helpviewer_keywords:
66
- unit tests, creating
@@ -17,14 +17,25 @@ If you have a 64-bit machine, you can run unit tests and capture code coverage i
1717

1818
## To run a unit test as a 64-bit process
1919

20-
1. If your code or tests were compiled as 32-bit/x86, but you now want to run them as a 64-bit process, recompile them as **Any CPU**, or optionally as **64-bit**.
20+
1. If your code or tests were compiled as 32-bit/x86, but you now want to run them as a 64-bit process, recompile them as **Any CPU**.
21+
22+
::: moniker range="vs-2017"
23+
Alternatively, In Visual Studio 2017, you could also compile your project as **64-bit**.
24+
::: moniker-end
2125

2226
> [!TIP]
2327
> For maximum flexibility, compile your test projects with the **Any CPU** configuration. Then you can run on both 32-bit and 64-bit agents. There's no advantage to compiling test projects with the **64-bit** configuration.
2428
25-
2. From the Visual Studio menu, choose **Test**, then choose **Settings**, and then choose **Processor Architecture**. Choose **x64** to run the tests as a 64-bit process.
29+
2. Set the unit tests to run as a 64-bit process.
30+
31+
::: moniker range=">=vs-2019"
32+
From the Visual Studio menu, choose **Test**, then choose **Processor Architecture for AnyCPU projects**. Choose **x64** to run the tests as a 64-bit process.
33+
::: moniker-end
34+
::: moniker range="vs-2017"
35+
From the Visual Studio menu, choose **Test**, then choose **Test Settings**, and then choose **Processor Architecture**. Choose **x64** to run the tests as a 64-bit process.
36+
::: moniker-end
2637

27-
- or -
38+
\- or -
2839

2940
Specify `<TargetPlatform>x64</TargetPlatform>` in a *.runsettings* file. An advantage of this method is that you can specify groups of settings in different files and quickly switch between different settings. You can also copy settings between solutions. For more information, see [Configure unit tests by using a .runsettings file](../test/configure-unit-tests-by-using-a-dot-runsettings-file.md).
3041

0 commit comments

Comments
 (0)