Skip to content

Commit f8cde07

Browse files
authored
Merge branch 'main' into change-master-to-main-for-github-links
2 parents 63d2a59 + ac1bd0e commit f8cde07

File tree

80 files changed

+1056
-611
lines changed

Some content is hidden

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

80 files changed

+1056
-611
lines changed

.openpublishing.publish.config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"moniker_ranges": [],
1111
"open_to_public_contributors": true,
1212
"type_mapping": {
13-
"Conceptual": "Content"
13+
"Conceptual": "Content",
14+
"ZonePivotGroups": "Toc"
1415
},
1516
"build_entry_point": "docs",
1617
"template_folder": "_themes"

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,11 @@
10001000
"redirect_url": "/visualstudio/ide/understanding-build-configurations",
10011001
"redirect_document_id": false
10021002
},
1003+
{
1004+
"source_path": "docs/ide/copilot-free-plan.md",
1005+
"redirect_url": "/visualstudio/ide/visual-studio-github-copilot-install-and-states",
1006+
"redirect_document_id": false
1007+
},
10031008
{
10041009
"source_path": "docs/msbuild/logging-in-a-multi-processor-environment.md",
10051010
"redirect_url": "/visualstudio/msbuild/writing-multi-processor-aware-loggers",

.whatsnew.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"labels": [
1111
"-label:CLA"
1212
],
13-
"minAdditionsToFile": 10
13+
"minAdditionsToFile": 2
1414
},
1515
"areas": [
1616
{

docs/code-quality/code-metrics-cyclomatic-complexity.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Code metrics - Cyclomatic complexity
3-
ms.date: 5/7/2021
3+
ms.date: 12/10/2024
44
description: Explore the cyclomatic complexity metric for code metrics in Visual Studio and estimate the difficulty to test, maintain, and troubleshoot your code.
55
ms.topic: conceptual
66
author: mikejo5000
@@ -25,33 +25,33 @@ Notice the cyclomatic complexity is at 2 (the lowest value possible). If you add
2525

2626
![Cyclomatic complexity example 2](media/cyclomatic-complexity-example-2.png)
2727

28-
If you add a decision, the cyclomatic complexity value goes up by 1:
28+
If you add a decision, the cyclomatic complexity value goes up by one:
2929

3030
![Cyclomatic complexity example 3](media/cyclomatic-complexity-example-3.png)
3131

32-
When you change the if statement to a switch statement with 4 decisions to be made then, it goes from the original 2 to 6:
32+
When you change the if statement to a switch statement with four decisions to be made then, it goes from the original two to six:
3333

3434
![Cyclomatic complexity example 4](media/cyclomatic-complexity-example-4.png)
3535

3636
Let's take a look at a (hypothetical) larger code base.
3737

3838
![Cyclomatic complexity example 5](media/cyclomatic-complexity-example-5.png)
3939

40-
Notice that most of the items, as you drill down into the Products_Related class, have a value of 1 but a couple of them have a complexity of 5. By itself, this might not be a big deal, but given that most other members have a 1 in the same class, you should definitely look closer at those two items and see what is in them. You can do this by right-clicking the item and choosing **Go To Source Code** from the context menu. Take a closer look at `Product.set(Product)`:
40+
Notice that most of the items, as you drill down into the Products_Related class, have a value of one but a couple of them have a complexity of five. By itself, this difference might not be a big deal, but given that most other members have a one in the same class, you should definitely look closer at those two items and see what is in them. You can do take a closer look by right-clicking the item and choosing **Go To Source Code** from the context menu. Take a closer look at `Product.set(Product)`:
4141

4242
![Cyclomatic complexity example 6](media/cyclomatic-complexity-example-6.png)
4343

44-
Given all the if statements, you can see why the cyclomatic complexity is at a 5. At this point, you might decide that this is an acceptable level of complexity, or you might refactor to reduce the complexity.
44+
Given all the if statements, you can see why the cyclomatic complexity is at a five. At this point, you might decide that this result is an acceptable level of complexity, or you might refactor to reduce the complexity.
4545

4646
## The Magic Number
4747

48-
As with many metrics in this industry, there is no exact cyclomatic complexity limit that fits all organizations. However, [NIST235](#nist235) does indicate that a limit of 10 is a good starting point:
48+
As with many metrics in this industry, there's no exact cyclomatic complexity limit that fits all organizations. However, [NIST235](#nist235) does indicate that a limit of 10 is a good starting point:
4949

50-
"The precise number to use as a limit, however, remains somewhat controversial. The original limit of 10 as proposed by McCabe has significant supporting evidence, but limits as high as 15 have been used successfully as well. Limits over 10 should be reserved for projects that have several operational advantages over typical projects, for example experienced staff, formal design, a modern programming language, structured programming, code walkthroughs, and a comprehensive test plan. In other words, an organization can pick a complexity limit greater than 10, but only if it is sure it knows what it is doing and is willing to devote the additional testing effort required by more complex modules." [NIST235](#nist235)
50+
"The precise number to use as a limit, however, remains somewhat controversial. The original limit of 10 as proposed by McCabe has significant supporting evidence, but limits as high as 15 have been used successfully as well. Limits over 10 should be reserved for projects that have several operational advantages over typical projects, for example experienced staff, formal design, a modern programming language, structured programming, code walkthroughs, and a comprehensive test plan. In other words, an organization can pick a complexity limit greater than 10, but only if it's sure it knows what it's doing and is willing to devote the additional testing effort required by more complex modules." [NIST235](#nist235)
5151

5252
## Cyclomatic Complexity and Line Numbers
5353

54-
Just looking at the number of lines of code by itself is, at best, a very broad predictor of code quality. There is some basic truth to the idea that the more lines of code in a function, the more likely it is to have errors. However, when you combine cyclomatic complexity with lines of code, then you have a much clearer picture of the potential for errors.
54+
Just looking at the number of lines of code by itself is, at best, a very broad predictor of code quality. There's some basic truth to the idea that the more lines of code in a function, the more likely it's to have errors. However, when you combine cyclomatic complexity with lines of code, then you have a much clearer picture of the potential for errors.
5555

5656
As described by the Software Assurance Technology Center (SATC) at NASA:
5757

docs/code-quality/index.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ metadata:
1010
ms.topic: landing-page
1111
author: Mikejo5000
1212
ms.author: mikejo
13-
ms.date: 10/15/2019
13+
ms.date: 12/10/2024
1414

1515
# linkListType: architecture | concept | deploy | download | get-started | how-to-guide | learn | overview | quickstart | reference | tutorial | video | whats-new
1616

@@ -53,9 +53,9 @@ landingContent:
5353
url: /dotnet/fundamentals/productivity/code-analysis#code-style-analysis
5454
- linkListType: reference
5555
links:
56-
- text: .NET code quality rules
56+
- text: .NET code quality rules >>
5757
url: /dotnet/fundamentals/code-analysis/quality-rules/
58-
- text: .NET code style rules
58+
- text: .NET code style rules >>
5959
url: /dotnet/fundamentals/code-analysis/style-rules/
6060

6161
# Card

docs/containers/deploy-app-service.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ ms.author: ghogen
1414

1515
This tutorial walks you through using Visual Studio to publish your containerized ASP.NET Core web application to an [Azure App Service](/azure/app-service). Azure App Service is an appropriate service for a single-container web app hosted in Azure.
1616

17+
You can also deploy to [Azure Container Apps](/azure/container-apps/overview). For a tutorial, see [Deploy to Azure Container Apps using Visual Studio](/azure/container-apps/deploy-visual-studio).
18+
1719
If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/dotnet/?utm_source=acr-publish-doc&utm_medium=docs&utm_campaign=docs) before you begin.
1820

1921
## Prerequisites

docs/containers/index.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ landingContent:
5454
url: hosting-web-apps-in-docker.md
5555
- text: Deploy to Azure App Service
5656
url: deploy-app-service.md
57+
- text: Deploy to Azure Container apps
58+
url: /azure/container-apps/deploy-visual-studio
5759
- text: Deploy to Docker Hub
5860
url: deploy-docker-hub.md
5961
- text: Deploy without a Dockerfile

docs/containers/launch-profiles.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ manager: mijacobs
66
ms.subservice: container-tools
77
ms.devlang: dotnet
88
ms.topic: how-to
9-
ms.date: 10/08/2021
9+
ms.date: 12/10/2024
1010
ms.author: ghogen
1111
monikerRange: ">=vs-2019"
1212
---
1313

1414
# Launch a subset of Compose services
1515

16-
If you have an application that consists of multiple services and uses Docker Compose, you can configure which services run and debug by creating or editing an existing launch profile in Docker Compose launch settings. Launch profiles allow you to dynamically run only the services that matter to your current scenario. You can create and select from launch profiles in order to customize your debugging experience and set specific launch actions such as `Browser Launch URL`. You will also have the option of either choosing each service individually or by choosing a Docker Compose profile, which also looks at your Compose file to determine the group of services to run.
16+
If you have an application that consists of multiple services and uses Docker Compose, you can configure which services run and debug by creating or editing an existing launch profile in Docker Compose launch settings. Launch profiles allow you to dynamically run only the services that matter to your current scenario. You can create and select from launch profiles in order to customize your debugging experience and set specific launch actions such as `Browser Launch URL`. You also have the option of either choosing each service individually or by choosing a Docker Compose profile, which also looks at your Compose file to determine the group of services to run.
1717

1818
For information about Docker Compose profiles, see [Using profiles with Compose](https://docs.docker.com/compose/profiles/).
1919

@@ -97,7 +97,7 @@ The next example demonstrates selecting between individual services instead of f
9797

9898
![Screenshot of launch settings dialog with some services deselected](media/launch-settings/launch-settings-selected.png)
9999

100-
And this information will be saved in *launchSettings.json* as shown below
100+
And this information is saved in *launchSettings.json* as shown below
101101

102102
```json
103103
{
@@ -124,14 +124,14 @@ And this information will be saved in *launchSettings.json* as shown below
124124

125125
You can also further customize launch behaviors by creating Visual Studio launch profiles that make use of the Compose profiles.
126126

127-
To create another profile that makes use of the Compose profile, select **Use Docker Compose profiles** and choose `web1`. Now the launch profile includes three services`webapplication1` (which belongs to both `web` and `web1` Compose profiles), `external1` and `external2`. By default, the services without source code such as `external1` and `external2` have the default action of **Start without debugging**. .NET applications with source code will default to **Start debugging**.
127+
To create another profile that makes use of the Compose profile, select **Use Docker Compose profiles** and choose `web1`. Now the launch profile includes three services: `webapplication1` (which belongs to both `web` and `web1` Compose profiles), `external1`, and `external2`. By default, the services without source code such as `external1` and `external2` have the default action of **Start without debugging**. .NET applications with source code defaults to **Start debugging**.
128128

129129
> [!IMPORTANT]
130-
> If a service doesn't specify a Compose profile, it will be included in all Compose profiles implicitly.
130+
> If a service doesn't specify a Compose profile, it's included in all Compose profiles implicitly.
131131
132132
![Screenshot of launch settings dialog with another profile created](media/launch-settings/launch-settings-create-profile.png)
133133

134-
This information will be saved as shown in the following code. The configuration for the service and its default action are not saved unless you change the default action.
134+
This information is saved as shown in the following code. The configuration for the service and its default action are not saved unless you change the default action.
135135

136136
```json
137137
{
@@ -172,7 +172,7 @@ You can also change the action of webapplication1 to **Start without debugging**
172172

173173
## Properties
174174

175-
Here is a description of each property in the *launchSettings.json*:
175+
Here's a description of each property in the *launchSettings.json*:
176176

177177
|Property| Description|
178178
| - | - |

docs/containers/overview.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,3 +291,7 @@ For further details on the services implementation and use of Visual Studio tool
291291
[Debugging apps in a local Docker container](edit-and-refresh.md)
292292

293293
[Deploy an ASP.NET container to a container registry using Visual Studio](hosting-web-apps-in-docker.md)
294+
295+
[Deploy to Azure App Service](deploy-app-service.md)
296+
297+
[Deploy to Azure Container Apps using Visual Studio](/azure/container-apps/deploy-visual-studio)

docs/data-tools/connect-to-data-in-an-access-database-windows-forms.md

Lines changed: 4 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ Connect to databases created with Microsoft 365, Access 2016, Access 2013, Acces
100100
![Screenshot of Data Sources Window, populated with database objects](media/vs-2022/data-sources-window-populated.png)
101101

102102
14. On 64-bit machines with the 64-bit Access database engine, you need to ensure that the application runs as a 64-bit application. Open the project properties (press **Alt**+**Enter** or right-click on the project node, and select **Properties**). In the **Build** tab, clear the **Prefer 32-bit** checkbox.
103+
104+
The connection string is stored in *app.config*, and in the *Settings.settings* file under **Properties** in Solution Explorer.
105+
103106
:::moniker-end
104107

105108
:::moniker range="vs-2019"
@@ -197,60 +200,7 @@ Connect to databases created with Access 2000-2003 by using the following proced
197200

198201
## View the generated code
199202

200-
The data tools are configured to generate a lot of code automatically when you perform certain operations in the Form Designer. For example, when you drag and drop a table onto the form, a `DataGridView` is added and code is created to hook up the data with the control. You can view this code in the `*.Designer.cs` file. Visual Studio adds a number of private members:
201-
202-
```csharp
203-
private Database11DataSet database11DataSet;
204-
private System.Windows.Forms.BindingSource ordersBindingSource;
205-
private Database11DataSetTableAdapters.OrdersTableAdapter ordersTableAdapter;
206-
private Database11DataSetTableAdapters.TableAdapterManager tableAdapterManager;
207-
private System.Windows.Forms.BindingNavigator ordersBindingNavigator;
208-
private System.Windows.Forms.ToolStripButton bindingNavigatorAddNewItem;
209-
private System.Windows.Forms.ToolStripLabel bindingNavigatorCountItem;
210-
private System.Windows.Forms.ToolStripButton bindingNavigatorDeleteItem;
211-
private System.Windows.Forms.ToolStripButton bindingNavigatorMoveFirstItem;
212-
private System.Windows.Forms.ToolStripButton bindingNavigatorMovePreviousItem;
213-
private System.Windows.Forms.ToolStripSeparator bindingNavigatorSeparator;
214-
private System.Windows.Forms.ToolStripTextBox bindingNavigatorPositionItem;
215-
private System.Windows.Forms.ToolStripSeparator bindingNavigatorSeparator1;
216-
private System.Windows.Forms.ToolStripButton bindingNavigatorMoveNextItem;
217-
private System.Windows.Forms.ToolStripButton bindingNavigatorMoveLastItem;
218-
private System.Windows.Forms.ToolStripSeparator bindingNavigatorSeparator2;
219-
private System.Windows.Forms.ToolStripButton ordersBindingNavigatorSaveItem;
220-
private System.Windows.Forms.DataGridView ordersDataGridView;
221-
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
222-
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
223-
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
224-
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
225-
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;
226-
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;
227-
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;
228-
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn8;
229-
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn9;
230-
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn10;
231-
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn11;
232-
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn12;
233-
```
234-
235-
If you expand the hidden region, you can see that Visual Studio also adds a large amount of code to set up the `DataGridView` control with data binding to the table you dragged to the form.
236-
237-
Also, in the main form code-behind file, Visual Studio adds code that processes the save action to save interactive changes to the data, and the code that loads the table into the table adapter.
238-
239-
```csharp
240-
private void ordersBindingNavigatorSaveItem_Click(object sender, EventArgs e)
241-
{
242-
this.Validate();
243-
this.ordersBindingSource.EndEdit();
244-
this.tableAdapterManager.UpdateAll(this.database11DataSet);
245-
246-
}
247-
248-
private void Form1_Load(object sender, EventArgs e)
249-
{
250-
// TODO: This line of code loads data into the 'database11DataSet.Orders' table. You can move, or remove it, as needed.
251-
this.ordersTableAdapter.Fill(this.database11DataSet.Orders);
252-
}
253-
```
203+
The data tools are configured to generate a lot of code automatically when you perform certain operations in the Form Designer. For example, when you drag and drop a table onto the form, a `DataGridView` is added and code is created to hook up the data with the control. You can view this code in the `*.Designer.cs` file. The generated code may differ depending on your version of Visual Studio.
254204

255205
Congratulations! With a little help from Visual Studio, you've created a form-based editing experience for an Access data table.
256206

0 commit comments

Comments
 (0)