Skip to content

Commit bba863c

Browse files
authored
Merge pull request #4134 from MicrosoftDocs/master637068648537821390
For protected CLA branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents 6f70f15 + 6244689 commit bba863c

19 files changed

+228
-148
lines changed

docs/code-quality/ca1026-default-parameters-should-not-be-used.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ ms.workload:
2727
## Cause
2828
An externally visible type contains an externally visible method that uses a default parameter.
2929

30+
> [!NOTE]
31+
> This legacy rule is not available in FxCop Analyzers. For more information, see [Deprecated rules](fxcop-rule-port-status.md#deprecated-rules).
32+
3033
## Rule description
3134
Methods that use default parameters are allowed under the Common Language Specification (CLS); however, the CLS allows compilers to ignore the values that are assigned to these parameters. Code that is written for compilers that ignore default parameter values must explicitly provide arguments for each default parameter. To maintain the behavior that you want across programming languages, methods that use default parameters should be replaced with method overloads that provide the default parameters.
3235

docs/code-quality/ca3075.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class TestClass
107107
{
108108
var src = "";
109109
TextReader tr = new StreamReader(src);
110-
XmlTextReader reader = new XmlTextReader(tr) { DtdProcessing = DtdProcessing.Prohibit };
110+
XmlReader reader = XmlReader.Create(tr, new XmlReaderSettings() { XmlResolver = null });
111111
XmlSchema schema = XmlSchema.Read(reader , null);
112112
return schema;
113113
}
@@ -362,3 +362,6 @@ namespace TestNamespace
362362
}
363363
}
364364
```
365+
366+
> [!NOTE]
367+
> Although <xref:System.Xml.XmlReader.Create%2A?displayProperty=nameWithType> is the recommended way to create an <xref:System.Xml.XmlReader> instance, there are behavior differences from <xref:System.Xml.XmlTextReader>. An <xref:System.Xml.XmlReader> from <xref:System.Xml.XmlReader.Create%2A> normalizes `\r\n` to `\n` in XML values, while <xref:System.Xml.XmlTextReader> preserves the `\r\n` sequence.

docs/containers/container-tools-react.md

Lines changed: 77 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
title: Visual Studio Container Tools with ASP.NET Core
2+
title: Visual Studio Container Tools with ASP.NET Core and React.js
33
author: ghogen
44
description: Learn how to use Visual Studio Container Tools and Docker for Windows
55
ms.author: ghogen
6-
ms.date: 06/06/2019
6+
ms.date: 10/16/2019
77
ms.technology: vs-azure
88
ms.topic: quickstart
99
---
@@ -17,12 +17,16 @@ With Visual Studio, you can easily build, debug, and run containerized ASP.NET C
1717
* [Docker Desktop](https://hub.docker.com/editions/community/docker-ce-desktop-windows)
1818
* [Visual Studio 2017](https://visualstudio.microsoft.com/vs/older-downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=vs+2017+download) with the **Web Development**, **Azure Tools** workload, and/or **.NET Core cross-platform development** workload installed
1919
* To publish to Azure Container Registry, an Azure subscription. [Sign up for a free trial](https://azure.microsoft.com/offers/ms-azr-0044p/).
20+
* [Node.js](https://nodejs.org/en/download/)
21+
* For Windows containers, Windows 10 version 1903 or later, to use the Docker images referenced in this article.
2022
::: moniker-end
2123
::: moniker range=">=vs-2019"
2224
* [Docker Desktop](https://hub.docker.com/editions/community/docker-ce-desktop-windows)
2325
* [Visual Studio 2019](https://visualstudio.microsoft.com/downloads) with the **Web Development**, **Azure Tools** workload, and/or **.NET Core cross-platform development** workload installed
2426
* [.NET Core 2.2 Development Tools](https://dotnet.microsoft.com/download/dotnet-core/2.2) for development with .NET Core 2.2
2527
* To publish to Azure Container Registry, an Azure subscription. [Sign up for a free trial](https://azure.microsoft.com/offers/ms-azr-0044p/).
28+
* [Node.js](https://nodejs.org/en/download/)
29+
* For Windows containers, Windows 10 version 1903 or later, to use the Docker images referenced in this article.
2630
::: moniker-end
2731

2832
## Installation and setup
@@ -41,7 +45,7 @@ For Docker installation, first review the information at [Docker Desktop for Win
4145

4246
![Add Docker support](media/container-tools-react/vs2017/add-docker-support.png)
4347

44-
1. Select the Linux container type, and click **OK**.
48+
1. Select the container type, and click **OK**.
4549
::: moniker-end
4650
::: moniker range=">=vs-2019"
4751
1. Create a new project using the **ASP.NET Core Web Application** template.
@@ -53,10 +57,12 @@ For Docker installation, first review the information at [Docker Desktop for Win
5357

5458
![Add Docker support](media/container-tools-react/vs2017/add-docker-support.png)
5559

56-
1. Select Linux as the container type.
60+
1. Select the container type.
5761
::: moniker-end
5862

59-
## Dockerfile overview
63+
The next step is different depending on whether you're using Linux containers or Windows containers.
64+
65+
## Modify the Dockerfile (Linux containers)
6066

6167
A *Dockerfile*, the recipe for creating a final Docker image, is created in the project. Refer to [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) for an understanding of the commands within it.
6268

@@ -98,9 +104,74 @@ The preceding *Dockerfile* is based on the [microsoft/aspnetcore](https://hub.do
98104

99105
When the new project dialog's **Configure for HTTPS** check box is checked, the *Dockerfile* exposes two ports. One port is used for HTTP traffic; the other port is used for HTTPS. If the check box isn't checked, a single port (80) is exposed for HTTP traffic.
100106

107+
## Modify the Dockerfile (Windows containers)
108+
109+
Open the project file by double-clicking on the project node, and update the project file (*.csproj) by adding the following property as a child of the `<PropertyGroup>` element:
110+
111+
```xml
112+
<DockerfileFastModeStage>base</DockerfileFastModeStage>
113+
```
114+
115+
Update the Dockerfile by adding the following lines. This will copy node and npm to the container.
116+
117+
1. Add ``# escape=` `` to the first line of the Dockerfile
118+
1. Add the following lines before `FROM … base`
119+
120+
```
121+
FROM mcr.microsoft.com/powershell:nanoserver-1903 AS downloadnodejs
122+
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop';$ProgressPreference='silentlyContinue';"]
123+
RUN Invoke-WebRequest -OutFile nodejs.zip -UseBasicParsing "https://nodejs.org/dist/v10.16.3/node-v10.16.3-win-x64.zip"; `
124+
Expand-Archive nodejs.zip -DestinationPath C:\; `
125+
Rename-Item "C:\node-v10.16.3-win-x64" c:\nodejs
126+
```
127+
128+
1. Add the following line before and after `FROM … build`
129+
130+
```
131+
COPY --from=downloadnodejs C:\nodejs\ C:\Windows\system32\
132+
```
133+
134+
1. The complete Dockerfile should now look something like this:
135+
136+
```
137+
# escape=`
138+
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
139+
#For more information, please see https://aka.ms/containercompat
140+
FROM mcr.microsoft.com/powershell:nanoserver-1903 AS downloadnodejs
141+
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop';$ProgressPreference='silentlyContinue';"]
142+
RUN Invoke-WebRequest -OutFile nodejs.zip -UseBasicParsing "https://nodejs.org/dist/v10.16.3/node-v10.16.3-win-x64.zip"; `
143+
RUN Expand-Archive nodejs.zip -DestinationPath C:\; `
144+
RUN Rename-Item "C:\node-v10.16.3-win-x64" c:\nodejs
145+
146+
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-nanoserver-1903 AS base
147+
WORKDIR /app
148+
EXPOSE 80
149+
EXPOSE 443
150+
COPY --from=downloadnodejs C:\nodejs\ C:\Windows\system32\
151+
152+
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-nanoserver-1903 AS build
153+
COPY --from=downloadnodejs C:\nodejs\ C:\Windows\system32\
154+
WORKDIR /src
155+
COPY ["WebApplication7/WebApplication37.csproj", "WebApplication37/"]
156+
RUN dotnet restore "WebApplication7/WebApplication7.csproj"
157+
COPY . .
158+
WORKDIR "/src/WebApplication37"
159+
RUN dotnet build "WebApplication37.csproj" -c Release -o /app/build
160+
161+
FROM build AS publish
162+
RUN dotnet publish "WebApplication37.csproj" -c Release -o /app/publish
163+
164+
FROM base AS final
165+
WORKDIR /app
166+
COPY --from=publish /app/publish .
167+
ENTRYPOINT ["dotnet", "WebApplication37.dll"]
168+
```
169+
170+
1. Update the .dockerignore file by removing the `**/bin`.
171+
101172
## Debug
102173
103-
Select **Docker** from the debug drop-down in the toolbar, and start debugging the app. You might see a message with a prompt about trusting a certificate; choose to trust the certificate to continue.
174+
Select **Docker** from the debug drop-down in the toolbar, and start debugging the app. You might see a message with a prompt about trusting a certificate; choose to trust the certificate to continue. The first time you build, docker downloads the base images, so it might take a bit longer.
104175
105176
The **Container Tools** option in the **Output** window shows what actions are taking place. You should see the installation steps associated with *npm.exe*.
106177

docs/debugger/using-tracepoints.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ The behavior of the **When changed** option is different for different program
9898
- For native code, the debugger doesn't consider the first evaluation of the condition to be a change, so doesn't hit the tracepoint on the first evaluation.
9999
- For managed code, the debugger hits the tracepoint on the first evaluation after **When changed** is selected.
100100

101-
For a more comprehensive look at valid expressions you can use while setting conditions, see [Expressions in the debugger](expressions-in-the-debugger.md)
101+
For a more comprehensive look at valid expressions you can use while setting conditions, see [Expressions in the debugger](expressions-in-the-debugger.md).
102102

103103
### Hit count
104104
A hit count condition allows you to send output only after the line of code where the tracepoint is set has executed a specified number of times.
@@ -130,10 +130,13 @@ Sometimes when you inspect a property or attribute of an object, its value can c
130130

131131
The way that expressions are evaluated in the **Action** message box may be different than the language you are currently using for development. For example, to output a string you do not need to wrap a message in quotes even if you normally would while using `Debug.WriteLine()` or `console.log()`. Also, the curly brace syntax (`{ }`) to output expressions may also be different than the convention for outputting values in your development language. (However, the contents within the curly braces (`{ }`) should still be written using your development language’s syntax).
132132

133+
If you are trying to debug a live application and looking for a similar feature, check out our logpoint feature in the Snapshot Debugger. The snapshot debugger is a tool used to investigate issues in production applications. Logpoints also allow you to send messages to the Output Window without having to modify source code and do not impact your running application. For more information, see [Debug live Azure application](../debugger/debug-live-azure-applications.md).
134+
133135
## See also
134136

135137
- [What is debugging?](../debugger/what-is-debugging.md)
136138
- [Write better C# code using Visual Studio](../debugger/write-better-code-with-visual-studio.md)
137139
- [First look at debugging](../debugger/debugger-feature-tour.md)
138140
- [Expressions in the debugger](expressions-in-the-debugger.md)
139141
- [Use breakpoints](../debugger/using-breakpoints.md)
142+
- [Debug live Azure applications](../debugger/debug-live-azure-applications.md)

docs/ide/index-writing-code.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ landingContent:
5050
url: code-styles-and-code-cleanup.md
5151
- text: Code analysis
5252
url: ../code-quality/roslyn-analyzers-overview.md
53+
- text: IntelliCode
54+
url: /visualstudio/intellicode/intellicode-visual-studio
5355

5456
# Card
5557
- title: Get started with programming languages
@@ -65,4 +67,4 @@ landingContent:
6567
- text: Create a console app with Visual Basic
6668
url: quickstart-visual-basic-console.md
6769
- text: Create a web app with Node.js
68-
url: quickstart-nodejs.md
70+
url: quickstart-nodejs.md

docs/ide/quickstart-aspnet-core.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Create an ASP.NET Core web app in C#"
33
description: "Learn how to create a simple Hello World web app in Visual Studio with C# and ASP.NET Core, step-by-step."
44
ms.custom: "mvc,seodec18"
5-
ms.date: 06/06/2019
5+
ms.date: 10/15/2019
66
ms.technology: vs-ide-general
77
ms.prod: visual-studio-windows
88
ms.topic: quickstart
@@ -104,9 +104,9 @@ Soon after, Visual Studio opens your project file.
104104

105105
![in the 'Configure your new project' window, name your project 'HelloWorld'](../get-started/csharp/media/vs-2019/csharp-name-your-aspnet-helloworld-project.png)
106106

107-
1. In the **Create a new ASP.NET Core Web Application** window, verify that **ASP.NET Core 2.1** appears in the top drop-down menu. Then, choose **Web Application**, which includes example Razor Pages. Next, choose **Create**.
107+
1. In the **Create a new ASP.NET Core Web Application** window, verify that **ASP.NET Core 3.0** appears in the top drop-down menu. Then, choose **Web Application**, which includes example Razor Pages. Next, choose **Create**.
108108

109-
![The 'Create a new ASP.NET Core Web Application' window](../get-started/csharp/media/vs-2019/csharp-create-aspnet-core-razor-pages-app.png)
109+
![The 'Create a new ASP.NET Core Web Application' window](../get-started/csharp/media/vs-2019/csharp-create-aspnet-razor-pages-app.png)
110110

111111
Visual Studio opens your new project.
112112

docs/ide/step-1-create-a-project-and-add-a-table-to-your-form.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Step 1: Create a project and add a table to your form"
3-
ms.date: 05/31/2019
3+
ms.date: 10/15/2019
44
ms.topic: tutorial
55
ms.prod: visual-studio-windows
66
ms.technology: vs-ide-general
@@ -38,11 +38,11 @@ The first step in creating a matching game is to create the project and add a ta
3838

3939
![View the 'Create a new project' window](../get-started/media/vs-2019/create-new-project-dark-theme.png)
4040

41-
1. On the **Create a new project** window, enter or type *Windows Forms* in the search box.
41+
1. On the **Create a new project** window, enter or type *Windows Forms* in the search box. Next, choose **Desktop** from the **Project type** list.
4242

43-
1. Choose the **Windows Forms App (.NET Framework)** template, and then choose **Next**.
43+
After you apply the **Project type** filter, choose the **Windows Forms App (.NET Framework)** template for either C# or Visual Basic, and then choose **Next**.
4444

45-
![Choose the Visual Basic template for the Windows Forms App (.NET Framework)](../get-started/visual-basic/media/vs-2019/vb-create-new-project-search-winforms-filtered.png)
45+
![Choose the either the C# or Visual Basic template for the Windows Forms App (.NET Framework)](./media/create-new-project-search-winforms-filtered.png)
4646

4747
> [!NOTE]
4848
> If you do not see the **Windows Forms App (.NET Framework)** template, you can install it from the **Create a new project** window. In the **Not finding what you're looking for?** message, choose the **Install more tools and features** link.

docs/ide/step-1-create-a-project-and-add-labels-to-your-form.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Step 1: Create a project and add labels to your form"
3-
ms.date: 05/31/2019
3+
ms.date: 10/15/2019
44
ms.topic: tutorial
55
ms.prod: visual-studio-windows
66
ms.technology: vs-ide-general
@@ -43,11 +43,11 @@ As the first steps in developing this quiz, you create the project, and you add
4343

4444
![View the 'Create a new project' window](../get-started/media/vs-2019/create-new-project-dark-theme.png)
4545

46-
1. On the **Create a new project** window, enter or type *Windows Forms* in the search box.
46+
1. On the **Create a new project** window, enter or type *Windows Forms* in the search box. Next, choose **Desktop** from the **Project type** list.
4747

48-
1. Choose the **Windows Forms App (.NET Framework)** template, and then choose **Next**.
48+
After you apply the **Project type** filter, choose the **Windows Forms App (.NET Framework)** template for either C# or Visual Basic, and then choose **Next**.
4949

50-
![Choose the Visual Basic template for the Windows Forms App (.NET Framework)](../get-started/visual-basic/media/vs-2019/vb-create-new-project-search-winforms-filtered.png)
50+
![Choose the either the C# or Visual Basic template for the Windows Forms App (.NET Framework)](./media/create-new-project-search-winforms-filtered.png)
5151

5252
> [!NOTE]
5353
> If you do not see the **Windows Forms App (.NET Framework)** template, you can install it from the **Create a new project** window. In the **Not finding what you're looking for?** message, choose the **Install more tools and features** link.

docs/ide/step-1-create-a-windows-forms-application-project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ When you create a picture viewer, the first step is to create a Windows Forms Ap
4444

4545
After you apply the **Project type** filter, choose the **Windows Forms App (.NET Framework)** template for either C# or Visual Basic, and then choose **Next**.
4646

47-
![Choose the C# template for the Windows Forms App (.NET Framework)](./media/create-new-project-search-winforms-filtered.png)
47+
![Choose the either the C# or Visual Basic template for the Windows Forms App (.NET Framework)](./media/create-new-project-search-winforms-filtered.png)
4848

4949
> [!NOTE]
5050
> If you don't see the **Windows Forms App (.NET Framework)** template, you can install it from the **Create a new project** window. In the **Not finding what you're looking for?** message, choose the **Install more tools and features** link.

docs/ide/step-2-add-a-random-object-and-a-list-of-icons.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ ms.workload:
1515
- "multiple"
1616
---
1717
# Step 2: Add a Random object and a list of icons
18+
1819
In this step, you create a set of matching symbols for the game. Each symbol is added to two random cells in the TableLayoutPanel on the form. To do this, you use two `new` statements to create two objects. The first is a <xref:System.Random> object, like the one you used in the math quiz game. It is used in this code to randomly choose cells in the TableLayoutPanel. The second object, which may be new to you, is a <xref:System.Collections.Generic.List%601> object which is used to store the randomly-chosen symbols.
1920

2021
## To add a random object and a list of icons
2122

22-
1. In **Solution Explorer**, choose *Form1.cs* if you're using Visual C#, or *Form1.vb* if you're using Visual Basic, and then on the menu bar, choose **View** > **Code**. As an alternative, you can choose the **F7** key or double-click **Form1** in **Solution Explorer**.
23+
1. In **Solution Explorer**, choose *Form1.cs* if you're using C#, or *Form1.vb* if you're using Visual Basic, and then on the menu bar, choose **View** > **Code**. As an alternative, you can choose the **F7** key or double-click **Form1** in **Solution Explorer**.
2324

2425
This displays the code module behind Form1.
2526

@@ -35,8 +36,7 @@ In this step, you create a set of matching symbols for the game. Each symbol is
3536

3637
3. When adding the List object, notice the **IntelliSense** window that opens. The following is a Visual C# example, but similar text appears when you add a list in Visual Basic.
3738

38-
![Properties window showing Click event](../ide/media/express_listintellisense.png)
39-
IntelliSense window
39+
![Properties window showing Click event](../ide/media/express_listintellisense.png)<br/>***IntelliSense** window*
4040

4141
> [!NOTE]
4242
> The IntelliSense window appears only when you enter code manually. If you copy and paste the code, it doesn't appear.
@@ -54,6 +54,6 @@ IntelliSense window
5454
5555
## To continue or review
5656

57-
- To go to the next tutorial step, see [Step 3: Assign a random icon to each label](../ide/step-3-assign-a-random-icon-to-each-label.md).
57+
- To go to the next tutorial step, see [**Step 3: Assign a random icon to each label**](../ide/step-3-assign-a-random-icon-to-each-label.md).
5858

5959
- To return to the previous tutorial step, see [Step 1: Create a project and add a table to your form](../ide/step-1-create-a-project-and-add-a-table-to-your-form.md).

0 commit comments

Comments
 (0)