Skip to content

Commit 5a3d4e3

Browse files
authored
Merge pull request #8665 from MicrosoftDocs/repo_sync_working_branch
Confirm merge from repo_sync_working_branch to master to sync with https://github.com/MicrosoftDocs/visualstudio-docs (branch master)
2 parents 369692e + 36e272f commit 5a3d4e3

File tree

5 files changed

+45
-13
lines changed

5 files changed

+45
-13
lines changed

docs/extensibility/migration/update-visual-studio-extension.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ All these steps can be completed with Visual Studio 2019.
135135
Leave the `source.extension.vsixmanifest` file in the VSIX project.
136136
![Shared project contains all source files](media/update-visual-studio-extension/source-files-in-shared-project.png)
137137
138-
1. Metadata files (release notes, license, icons, and so on) and VSCT files should be moved to a shared directory and added as linked files to the VSIX project.
138+
1. Metadata files (release notes, license, icons, and so on) and VSCT files should be moved to a shared directory and added as linked files to the VSIX project. Note that the shared directory is separate from the shared project.
139139
![Add metadata and VSCT files as linked files](media/update-visual-studio-extension/add-linked-items-to-vsix.png)
140140
- For Metadata files, set BuildAction to `Content` and set Include in VSIX to `true`.
141141

docs/ide/reference/simplify-linq-expression.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Simplify LINQ expression
33
description: "This refactoring is used to remove unnecessary calls to the Enumerable for the Where method."
4-
ms.date: 08/12/2020
4+
ms.date: 07/05/2021
55
ms.topic: reference
66
author: m-redding
77
ms.author: midumont
@@ -22,7 +22,7 @@ This refactoring applies to:
2222

2323
**When:** All instances where the method calls `Single()`, `SingleOrDefault()`, and so on, doesn't have any arguments and is preceded by a `Where()` expression. The input to the `Where()` expression cannot be constructed as an expression tree.
2424

25-
**Why:** Removing the unnecessary call to the Enumerable for the `.Where()` method improves performance and readability.
25+
**Why:** Removing the unnecessary call to the Enumerable for the `.Where()` method improves readability and in some cases performance, see remarks.
2626

2727
## How-to
2828

@@ -31,6 +31,10 @@ This refactoring applies to:
3131
3. Select **Simplify LINQ expression**
3232

3333
![Convert typeof to nameof](media/simplify-linq-expression.png)
34+
35+
## Remarks
36+
37+
In some cases this refactoring may reduce performance. LINQ operations on `List<T>` and `T[]` are not optimized in this case and result in worse performance.
3438

3539
## See also
3640

docs/ide/work-with-multi-factor-authentication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Clicking on **Reenter your credentials** will open your system's default web bro
6363
6464
## How to opt out of using a specific Azure Active Directory tenant in Visual Studio
6565

66-
Visual Studio 2019 version 16.6 offers the flexibility to filter out tenants individually or globally, effectively hidding them from Visual Studio. Filtering eliminates the need to authenticate with that tenant, but it also means that you won't be able to access any associated resources.
66+
Visual Studio 2019 version 16.6 offers the flexibility to filter out tenants individually or globally, effectively hiding them from Visual Studio. Filtering eliminates the need to authenticate with that tenant, but it also means that you won't be able to access any associated resources.
6767

6868
This functionality is useful when you have multiple tenants, but want to optimize your development environment by targeting a specific subset. It can also help in instances when you can't validate a particular CA/MFA policy, as you can filter out the offending tenant.
6969

docs/msbuild/property-functions.md

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,32 +210,60 @@ $([MSBuild]::EnsureTrailingSlash('$(PathProperty)'))
210210

211211
## MSBuild GetDirectoryNameOfFileAbove
212212

213-
The MSBuild `GetDirectoryNameOfFileAbove` property function looks for a file in the directories above the current directory in the path.
213+
The MSBuild `GetDirectoryNameOfFileAbove` property function searches upward for a directory containing the specified file, beginning in (and including) the specified directory. It returns the full path of the nearest directory containing the file if it is found, otherwise an empty string.
214214

215-
This property function has the following syntax:
215+
This property function has the following syntax:
216216

217217
```
218-
$([MSBuild]::GetDirectoryNameOfFileAbove(string ThePath, string TheFile))
218+
$([MSBuild]::GetDirectoryNameOfFileAbove(string startingDirectory, string fileName))
219219
```
220220

221-
The following code is an example of this syntax.
221+
This example shows how to import the nearest *EnlistmentInfo.props* file in or above the current folder, only if a match is found:
222222

223223
```xml
224224
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), EnlistmentInfo.props))\EnlistmentInfo.props" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), EnlistmentInfo.props))' != '' " />
225225
```
226226

227+
Note that this example can be written more concisely by using the `GetPathOfFileAbove` function instead:
228+
229+
```xml
230+
<Import Project="$([MSBuild]::GetPathOfFileAbove(EnlistmentInfo.props))" Condition=" '$([MSBuild]::GetPathOfFileAbove(EnlistmentInfo.props))' != '' " />
231+
```
232+
227233
## MSBuild GetPathOfFileAbove
228234

229-
The `GetPathOfFileAbove` property function in MSBuild returns the path of the specified file, if located in the directory structure above the current directory. It is functionally equivalent to calling
235+
The MSBuild `GetPathOfFileAbove` property function searches upward for a directory containing the specified file, beginning in (and including) the specified directory. It returns the full path of the nearest matching file if it is found, otherwise an empty string.
236+
237+
This property function has the following syntax:
238+
239+
```
240+
$([MSBuild]::GetDirectoryNameOfFileAbove(string file, [string startingDirectory]))
241+
```
242+
243+
where `file` is the name of the file to search for and `startingDirectory` is an optional directory to start the search in. By default, the search will start in the current file's own directory.
244+
245+
This example shows how to import a file named *dir.props* in or above the current directory, only if a match is found:
230246

231247
```xml
232-
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
248+
<Import Project="$([MSBuild]::GetPathOfFileAbove(dir.props))" Condition=" '$([MSBuild]::GetPathOfFileAbove(dir.props))' != '' " />
233249
```
234250

235-
This property function has the following syntax:
251+
which is functionally equivalent to
252+
253+
```xml
254+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))' != '' " />
255+
```
236256

257+
However, sometimes you need to start the search in the parent directory, to avoid matching the current file. This example shows how a *Directory.Build.props* file can import the nearest *Directory.Build.props* file in a strictly higher level of the tree, without recursively importing itself:
258+
259+
```xml
260+
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
237261
```
238-
$([MSBuild]::GetPathOfFileAbove(dir.props))
262+
263+
which is functionally equivalent to
264+
265+
```xml
266+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildThisFileDirectory)../', 'Directory.Build.props'))/Directory.Build.props" />
239267
```
240268

241269
## MSBuild GetRegistryValue

docs/vsto/upgrading-and-migrating-office-solutions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Upgrade and migrate Office solutions"
3-
description: You must upgrade the project to use it in current versions of Visual Studio if you have a Offince project that was created in an earlier version of Visual Studio.
3+
description: You must upgrade the project to use it in current versions of Visual Studio if you have an Office project that was created in an earlier version of Visual Studio.
44
ms.custom: SEO-VS-2020
55
ms.date: "08/14/2019"
66
ms.topic: "conceptual"

0 commit comments

Comments
 (0)