Skip to content

Commit 548453b

Browse files
Merge pull request #10282 from MicrosoftDocs/main638543306830001314sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents 0de35f6 + 1c03e1f commit 548453b

File tree

6 files changed

+74
-52
lines changed

6 files changed

+74
-52
lines changed

.github/workflows/clean-repo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
pull-requests: write
1515

1616
steps:
17-
- uses: actions/[email protected].6
17+
- uses: actions/[email protected].7
1818

1919
# Call clean repo
2020
- name: Clean repo

.github/workflows/whats-new.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
pull-requests: write
1919

2020
steps:
21-
- uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62
21+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
2222

2323
- name: "Print manual run reason"
2424
if: ${{ github.event_name == 'workflow_dispatch' }}

docs/ide/managing-application-settings-dotnet.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Manage application settings (.NET)
3-
description: Manage application settings that aren't included in the application code but are needed at runtime with the Visual Studio integrated development environment (IDE).
4-
ms.date: 03/16/2023
3+
description: Manage application settings that aren't included in the application code but are needed at runtime with the Visual Studio IDE.
4+
ms.date: 05/31/2024
55
ms.topic: conceptual
66
f1_keywords:
77
- msvse_settingsdesigner.err.nameblank
@@ -11,6 +11,7 @@ author: anandmeg
1111
ms.author: meghaanand
1212
manager: mijacobs
1313
ms.subservice: general-ide
14+
#customer intent: As a developer, I want to use application settings to store information that isn't included in the application code at runtime.
1415
---
1516
# Manage application settings (.NET)
1617

@@ -19,7 +20,7 @@ Application settings enable you to store application information dynamically. Wi
1920
> [!NOTE]
2021
> Application settings replace the dynamic properties used in earlier versions of Visual Studio.
2122
22-
Each application setting must have a unique name. The name can be any combination of letters, numbers, or an underscore. However, the name can't start with a number, and it can't have spaces. The name is changed through the `Name` property.
23+
Each application setting must have a unique name. The name can be any combination of letters, numbers, or an underscore. The name can't start with a number, and it can't have spaces. The name is changed through the `Name` property.
2324

2425
Application settings can be stored as any data type that is serialized to XML or has a `TypeConverter` that implements `ToString`/`FromString`. The most common types are `String`, `Integer`, and `Boolean`. You can also store values as <xref:System.Drawing.Color>, <xref:System.Object>, or as a connection string.
2526

@@ -39,9 +40,9 @@ The project system stores application settings in two XML files:
3940

4041
- An *app.config* file, which is created at design time when you create the first application setting
4142

42-
- A *user.config* file, which is created at runtime when the user who runs the application changes the value of any user setting.
43+
- A *user.config* file, which is created at runtime when the user who runs the application changes the value of any user setting
4344

44-
Notice that changes in user settings aren't written to disk unless the application specifically calls a method to do so.
45+
Changes in user settings aren't written to disk unless the application specifically calls a method to do so.
4546

4647
## Create application settings at design time
4748

@@ -51,14 +52,14 @@ At design time, you can create application settings in two ways:
5152

5253
- Use the **Properties** window for a form or control, which allows you to bind a setting to a property.
5354

54-
When you create an application-scoped setting (for example, a database connection string, or a reference to server resources), Visual Studio saves it in *app.config* file with the `<applicationSettings>` tag. (Connection strings are saved under the `<connectionStrings>` tag.)
55+
When you create an application-scoped setting (for example, a database connection string, or a reference to server resources), Visual Studio saves it in the *app.config* file with the `<applicationSettings>` tag. Connection strings are saved under the `<connectionStrings>` tag.
5556

5657
When you create a user-scoped setting (for example, default font, home page, or window size), Visual Studio saves it in *app.config* file with the `<userSettings>` tag.
5758

5859
> [!IMPORTANT]
5960
> When you store connection strings in *app.config*, you should take precautions to avoid revealing sensitive information, such as passwords or server paths, in the connection string.
6061
>
61-
> If you take connection string information from an external source, such as a user who supplies their user ID and password, you must be careful to ensure that the values you use to construct your connection string don't contain additional connection string parameters that change the behavior of your connection.
62+
> If you take connection string information from an external source, such as a user who supplies their user ID and password, ensure that the values you use to construct your connection string don't contain additional connection string parameters that change the behavior of your connection.
6263
>
6364
> Consider using the Protected Configuration feature to encrypt sensitive information in the configuration file. For more information, see [Protect connection information](/dotnet/framework/data/adonet/protecting-connection-information).
6465
@@ -71,17 +72,24 @@ You can add customized settings files to your project for convenient management
7172

7273
For example, you can add a *SpecialSettings.settings* file to your project. While your `SpecialSettings` class isn't exposed in the `My` namespace, **View Code** can read the custom settings file that contains `Partial Class SpecialSettings`.
7374

74-
The **Settings Designer** first searches for the *Settings.settings* file that the project system creates. This *Settings.settings* file is the default file that the [**Project Designer**](reference/project-properties-reference.md) displays in the **Settings** tab. The *Settings.settings* file is located in the *My Project* folder for Visual Basic projects and in the *Properties* folder for Visual C# projects. The **Project Designer** then searches for other settings files in the project's root folder. Therefore, you should put your custom settings file there. If you add a *.settings* file elsewhere in your project, the **Project Designer** won't be able to locate it.
75+
The **Settings Designer** first searches for the *Settings.settings* file that the project system creates. This *Settings.settings* file is the default file that the [Project Designer](reference/project-properties-reference.md) displays in the **Settings** tab. The *Settings.settings* file is located in the *My Project* folder for Visual Basic projects and in the *Properties* folder for Visual C# projects. The **Project Designer** then searches for other settings files in the project's root folder. Therefore, you should put your custom settings file there. If you add a *.settings* file elsewhere in your project, the **Project Designer** can't locate it.
7576

7677
## Access or change application settings at runtime in Visual Basic
7778

78-
In Visual Basic projects, you can access application settings at runtime by using the `My.Settings` object. On the **Settings** page, select the **View code** button to view the *Settings.vb* file. *Settings.vb* defines the `Settings` class, which enables you to handle these events on the settings class: <xref:System.Configuration.ApplicationSettingsBase.SettingChanging>, <xref:System.Configuration.ApplicationSettingsBase.PropertyChanged>, <xref:System.Configuration.ApplicationSettingsBase.SettingsLoaded>, and <xref:System.Configuration.ApplicationSettingsBase.SettingsSaving>. Notice that the `Settings` class in *Settings.vb* is a partial class that displays only the user-owned code, not the whole generated class. For more information about accessing application settings by using the `My.Settings` object, see [Access application settings (.NET Framework)](/dotnet/visual-basic/developing-apps/programming/app-settings/accessing-application-settings).
79+
In Visual Basic projects, you can access application settings at runtime by using the `My.Settings` object. On the **Settings** page, select the **View code** button to view the *Settings.vb* file. *Settings.vb* defines the `Settings` class, which enables you to handle these events on the settings class:
7980

80-
The values of any user-scoped settings that the user changes at runtime (for example, the position of a form) are stored in a *user.config* file. Notice that the default values are still saved in *app.config*.
81+
- <xref:System.Configuration.ApplicationSettingsBase.SettingChanging>
82+
- <xref:System.Configuration.ApplicationSettingsBase.PropertyChanged>
83+
- <xref:System.Configuration.ApplicationSettingsBase.SettingsLoaded>
84+
- <xref:System.Configuration.ApplicationSettingsBase.SettingsSaving>
8185

82-
If any user-scoped settings are changed during runtime, for example in testing the application, and want to reset these settings to their default values, select the **Synchronize** button.
86+
The `Settings` class in *Settings.vb* is a partial class that displays only the user-owned code, not the whole generated class. For more information about accessing application settings by using the `My.Settings` object, see [Access application settings (.NET Framework)](/dotnet/visual-basic/developing-apps/programming/app-settings/accessing-application-settings).
8387

84-
It's a recommended best practice to use the `My.Settings` object and the default *.settings* file to access settings. It's recommended because you can use the **Settings Designer** to assign properties to settings, and, additionally, user settings are automatically saved before application shutdown. However, your Visual Basic application can access settings directly. In that case you have to access the `MySettings` class and use a custom *.settings* file in the root of the project. You must save the user settings before ending the application, as you would do for a C# application (as described in the following section).
88+
The values of any user-scoped settings that the user changes at runtime, for example, the position of a form, are stored in a *user.config* file. The default values are still saved in *app.config*.
89+
90+
If any user-scoped settings are changed during runtime, for example in testing the application, and you want to reset these settings to their default values, select the **Synchronize** button.
91+
92+
We recommend that you use the `My.Settings` object and the default *.settings* file to access settings. You can use the **Settings Designer** to assign properties to settings, and, also, user settings are automatically saved before application shutdown. However, your Visual Basic application can access settings directly. In that case you have to access the `MySettings` class and use a custom *.settings* file in the root of the project. You must save the user settings before ending the application, as you would do for a C# application, as described in the following section.
8593

8694
<!-- markdownlint-disable MD003 MD020 -->
8795
## Access or change application settings at runtime in C#
@@ -99,7 +107,7 @@ You must explicitly call the `Save` method of this wrapper class in order to per
99107
Properties.Settings.Default.Save();
100108
```
101109

102-
For general information about accessing application settings through the `Settings` class, see [Application settings overview (.NET Framework)](/dotnet/framework/winforms/advanced/application-settings-overview). For information about iterating through the settings, see this [forum post](https://social.msdn.microsoft.com/Forums/vstudio/40fbb470-f1e8-4a02-a4a0-9f62b54d0fc4/is-this-possible-propertiessettingsdefault?forum=csharpgeneral).
110+
For general information about accessing application settings through the `Settings` class, see [Application settings overview (.NET Framework)](/dotnet/framework/winforms/advanced/application-settings-overview).
103111

104112
## Related content
105113

docs/ide/managing-project-and-solution-properties.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
---
22
title: Manage project and solution properties
33
description: Manage both the project properties and the solution properties in Visual Studio for C#, Visual Basic, F#, C++, and JavaScript projects.
4-
ms.date: 05/26/2023
4+
ms.date: 05/31/2024
55
ms.topic: conceptual
66
author: anandmeg
77
ms.author: meghaanand
88
manager: mijacobs
99
ms.subservice: general-ide
10+
#customer intent: As a developer, I want to understand product and solution properties in Visual Studio to manage different kinds of projects.
1011
---
1112
# Manage project and solution properties
1213

13-
Projects have properties that govern many aspects of compilation, debugging, testing and deploying. Some properties are common among all project types, and some are unique to specific languages or platforms.
14+
Projects have properties that govern many aspects of compilation, debugging, testing, and deploying. Some properties are common among all project types, and some are unique to specific languages or platforms.
1415

1516
You access project properties by right-clicking the [project node](use-solution-explorer.md#solution-explorer-ui) in **Solution Explorer** and selecting **Properties**, or by typing **properties** into the search box on the menu bar and selecting **Properties Window** from the results.
1617

1718
::: moniker range="vs-2022"
19+
1820
:::image type="content" source="media/vs-2022/properties-from-solution-explorer-context-menu.png" alt-text="Screenshot of the Solution Explorer context menu with the Properties option highlighted.":::
21+
1922
::: moniker-end
2023

2124
::: moniker range="vs-2019"
25+
2226
:::image type="content" source="media/vs-2019/properties-from-solution-explorer-context-menu.png" alt-text="Screenshot of the Solution Explorer context menu with the Properties option highlighted.":::
27+
2328
::: moniker-end
2429

2530
.NET projects might also have a properties node in the project tree itself.
@@ -35,26 +40,34 @@ Project properties are organized into groups, and each group has its own propert
3540

3641
### C#, Visual Basic, and F# projects
3742

38-
In C#, Visual Basic, and F# projects, properties are exposed in the [.NET **Project Designer**](reference/project-properties-reference.md).
43+
In C#, Visual Basic, and F# projects, properties are exposed in the [.NET Project Designer](reference/project-properties-reference.md).
3944

40-
The following screenshot shows the **Build** property page in the .NET Project Designer for a console project in C#:
45+
The following screenshot shows the **Build** property page in the .NET **Project Designer** for a console project in C#:
4146

4247
::: moniker range="vs-2022"
48+
4349
:::image type="content" source="reference/media/vs-2022/project-properties-designer-build-csharp.png" alt-text="Screenshot of the Project Designer, with the Build tab selected.":::
50+
4451
::: moniker-end
4552

4653
::: moniker range="vs-2019"
54+
4755
:::image type="content" source="reference/media/vs-2019/project-properties-designer-build-csharp.png" alt-text="Screenshot of the Project Designer, with the Build tab selected.":::
56+
4857
::: moniker-end
4958

50-
The following screenshot shows the **Compile** property page in the .NET Project Designer for a console project in Visual Basic:
59+
The following screenshot shows the **Compile** property page in the .NET **Project Designer** for a console project in Visual Basic:
5160

5261
::: moniker range="vs-2022"
62+
5363
:::image type="content" source="reference/media/vs-2022/project-properties-designer-compile-visual-basic.png" alt-text="Screenshot of the Project Designer, with the Compile tab selected.":::
64+
5465
::: moniker-end
5566

5667
::: moniker range="vs-2019"
68+
5769
:::image type="content" source="reference/media/vs-2019/project-properties-designer-compile-visual-basic.png" alt-text="Screenshot of the Project Designer, with the Compile tab selected.":::
70+
5871
::: moniker-end
5972

6073
For more information about each of the **Project Designer** properties, see [What is the .NET Project Designer](reference/project-properties-reference.md).
@@ -64,19 +77,18 @@ For more information about each of the **Project Designer** properties, see [Wha
6477
6578
### C++ and JavaScript projects
6679

67-
C++ and JavaScript projects have a different user interface for managing project properties. The following screenshot shows a C++ project property page (JavaScript pages are similar):
80+
C++ and JavaScript projects have a different user interface for managing project properties. The following screenshot shows a C++ project property page. JavaScript pages are similar.
6881

6982
:::image type="content" source="media/vs-2022/properties-page-cpp-console.png" alt-text="Screenshot of the C++ project properties page.":::
7083

7184
For information about C++ project properties, see [Work with project properties (C++)](/cpp/build/working-with-project-properties). For more information about JavaScript properties, see [Property pages, JavaScript](../ide/reference/property-pages-javascript.md).
7285

7386
## Solution properties
7487

75-
To access properties on the solution, right-click the [solution node](use-solution-explorer.md#solution-explorer-ui) in **Solution Explorer** and select **Properties**. In the dialog, you can set project configurations for **Debug** or **Release** builds, choose which projects should be the startup project when **F5** is pressed, and set code analysis options.
88+
To access properties on the solution, right-click the [solution node](use-solution-explorer.md#solution-explorer-ui) in **Solution Explorer** and select **Properties**. In the dialog box, you can set project configurations for **Debug** or **Release** builds, choose which projects should be the startup project when you select **F5**, and set code analysis options.
7689

77-
Solution properties are stored in a Solution User Options (.suo) file. For more information about this file type, see the "[**Solution file**](solutions-and-projects-in-visual-studio.md#solution-file)" section of the [Solutions and projects in Visual Studio](solutions-and-projects-in-visual-studio.md) page.
90+
Solution properties are stored in a Solution User Options (*.suo*) file. For more information about this file type, see [Solution file](solutions-and-projects-in-visual-studio.md#solution-file).
7891

7992
## Related content
8093

8194
- [What are solutions and projects in Visual Studio?](../ide/solutions-and-projects-in-visual-studio.md)
82-
- [Managing solution and project properties (Visual Studio for Mac)](/visualstudio/mac/managing-solutions-and-project-properties)

0 commit comments

Comments
 (0)