diff --git a/docs/debugger/create-custom-views-of-managed-objects.md b/docs/debugger/create-custom-views-of-managed-objects.md index 01548f19d61..28d2a1b74a4 100644 --- a/docs/debugger/create-custom-views-of-managed-objects.md +++ b/docs/debugger/create-custom-views-of-managed-objects.md @@ -1,7 +1,7 @@ --- -title: "Create custom views of managed objects | Microsoft Docs" +title: "Create custom views of .NET objects | Microsoft Docs" description: Visual Studio debugger displays data in its variable windows. Learn to customize how data types—including custom types—are displayed. -ms.date: "01/08/2019" +ms.date: "08/08/2023" ms.topic: "conceptual" f1_keywords: - "vs.debug.data.elements" @@ -26,23 +26,23 @@ ms.technology: vs-ide-debug ms.workload: - "dotnet" --- -# Create custom views of managed objects (C#, Visual Basic, F#, C++/CLI) +# Create custom views of .NET objects (C#, Visual Basic, F#, C++/CLI) [!INCLUDE [Visual Studio](~/includes/applies-to-version/vs-windows-only.md)] You can customize the way Visual Studio displays data types in debugger variable windows. ## Attributes -In C#, Visual Basic, F#, and C++ (C++/CLI code only), you can add expansions for custom data using , , and . +In C#, Visual Basic, F#, and C++ (C++/CLI code only), you can add expansions for custom data using , , and . In .NET Framework 2.0 code, Visual Basic does not support the DebuggerBrowsable attribute. This limitation is removed in more recent versions of .NET. ## Visualizers -You can write a visualizer to display any managed data type. For more information, see [How to: Write a Visualizer](create-custom-visualizers-of-data.md). +You can write a visualizer to display any .NET data type. For more information, see [Custom visualizers](create-custom-visualizers-of-data.md). > [!NOTE] -> For C++ code, you can add custom data type expansions using the Natvis framework, as described in [Create custom views of C++ objects in the debugger](create-custom-views-of-native-objects.md). +> To create a visualizer for C/C++ objects, see [UIVisualizer element](../debugger/create-custom-views-of-native-objects.md#BKMK_UIVisualizer) within the [Natvis](../debugger/create-custom-views-of-native-objects.md) documentation. Also, see the [C/C++ custom visualizer sample](https://github.com/Microsoft/ConcordExtensibilitySamples/tree/master/CppCustomVisualizer) or the [SQLite native Debugger Visualizer](https://github.com/Microsoft/VSSDK-Extensibility-Samples/tree/master/SqliteVisualizer) sample. ## See also diff --git a/docs/debugger/create-custom-visualizers-of-data.md b/docs/debugger/create-custom-visualizers-of-data.md index 49db66b819a..8aba630b4cb 100644 --- a/docs/debugger/create-custom-visualizers-of-data.md +++ b/docs/debugger/create-custom-visualizers-of-data.md @@ -1,7 +1,7 @@ --- -title: "Create custom data visualizers | Microsoft Docs" +title: "Custom data visualizers for .NET debugging | Microsoft Docs" description: Visual Studio debugger visualizers are components that display data. Learn about the six standard visualizers, and about how you can write or download others. -ms.date: "07/29/2021" +ms.date: "08/08/2023" ms.topic: "conceptual" f1_keywords: - "vs.debug.visualizer.troubleshoot" @@ -22,28 +22,31 @@ ms.technology: vs-ide-debug ms.workload: - "multiple" --- -# Create custom data visualizers +# Custom data visualizers for the Visual Studio debugger (.NET) - [!INCLUDE [Visual Studio](~/includes/applies-to-version/vs-windows-only.md)] +[!INCLUDE [Visual Studio](~/includes/applies-to-version/vs-windows-only.md)] - A *visualizer* is part of the [!INCLUDE[vs_current_short](../code-quality/includes/vs_current_short_md.md)] debugger user interface that displays a variable or object in a manner appropriate to its data type. For example, an HTML visualizer interprets an HTML string and displays the result as it would appear in a browser window. A bitmap visualizer interprets a bitmap structure and displays the graphic it represents. Some visualizers let you modify as well as view the data. +A *visualizer* is part of the [!INCLUDE[vs_current_short](../code-quality/includes/vs_current_short_md.md)] debugger user interface that displays a variable or object in a manner appropriate to its data type. For example, a [bitmap visualizer](/previous-versions/visualstudio/visual-studio-2015/debugger/image-watch/image-watch) interprets a bitmap structure and displays the graphic it represents. Some visualizers let you modify as well as view the data. In the debugger, a visualizer is represented by a magnifying glass icon ![VisualizerIcon](../debugger/media/dbg-tips-visualizer-icon.png "Visualizer icon"). You can select the icon in a **DataTip**, debugger **Watch** window, or **QuickWatch** dialog box, and then select the appropriate visualizer for the corresponding object. - The [!INCLUDE[vs_current_short](../code-quality/includes/vs_current_short_md.md)] debugger includes six standard visualizers. The text, HTML, XML, and JSON visualizers work on string objects. The WPF Tree visualizer displays the properties of a WPF object visual tree. The dataset visualizer works for DataSet, DataView, and DataTable objects. +In addition to the [standard built-in visualizers](../debugger/view-strings-visualizer.md), more visualizers may be available for download from Microsoft, third parties, and the community. You can also write your own visualizers and install them in the [!INCLUDE[vs_current_short](../code-quality/includes/vs_current_short_md.md)] debugger. -More visualizers may be available for download from Microsoft, third parties, and the community. You can also write your own visualizers and install them in the [!INCLUDE[vs_current_short](../code-quality/includes/vs_current_short_md.md)] debugger. +This article provides a high-level overview of visualizer creation. For detailed instructions, see the following articles instead: -In the debugger, a visualizer is represented by a magnifying glass icon ![VisualizerIcon](../debugger/media/dbg-tips-visualizer-icon.png "Visualizer icon"). You can select the icon in a **DataTip**, debugger **Watch** window, or **QuickWatch** dialog box, and then select the appropriate visualizer for the corresponding object. +- [Walkthrough: Write a visualizer in C#](../debugger/walkthrough-writing-a-visualizer-in-csharp.md) +- [Walkthrough: Write a visualizer in Visual Basic](../debugger/walkthrough-writing-a-visualizer-in-visual-basic.md) +- [Install a visualizer](../debugger/how-to-install-a-visualizer.md) +- (C/C++) [C/C++ custom visualizer sample](https://github.com/Microsoft/ConcordExtensibilitySamples/tree/master/CppCustomVisualizer) or the [SQLite native Debugger Visualizer](https://github.com/Microsoft/VSSDK-Extensibility-Samples/tree/master/SqliteVisualizer) sample. -## Write custom visualizers +> [!NOTE] +> Custom visualizers are not supported for UWP and Windows 8.x apps. - > [!NOTE] - > To create a custom visualizer for native code, see the [SQLite native Debugger Visualizer](https://github.com/Microsoft/VSSDK-Extensibility-Samples/tree/master/SqliteVisualizer) sample. Custom visualizers are not supported for UWP and Windows 8.x apps. +## Overview You can write a custom visualizer for an object of any managed class except for and . The architecture of a debugger visualizer has two parts: -- The *debugger side* runs within the Visual Studio debugger, and creates and displays the visualizer user interface. +- The *debugger side* runs within the Visual Studio debugger, and creates and displays the visualizer user interface. Because Visual Studio executes on the .NET Framework Runtime, this component has to be written for .NET Framework. For this reason, it is not possible to write it for .NET Core. @@ -61,9 +64,7 @@ You can write a visualizer for a generic type only if the type is an open type. Custom visualizers may have security considerations. See [Visualizer security considerations](../debugger/visualizer-security-considerations.md). -The following steps give a high-level overview of visualizer creation. For detailed instructions, see [Walkthrough: Write a visualizer in C#](../debugger/walkthrough-writing-a-visualizer-in-csharp.md) or [Walkthrough: Write a visualizer in Visual Basic](../debugger/walkthrough-writing-a-visualizer-in-visual-basic.md). - -### To create the debugger side +## Create the debugger side user interface To create the visualizer user interface on the debugger side, you create a class that inherits from , and override the method to display the interface. You can use to display Windows forms, dialogs, and controls in your visualizer. @@ -75,7 +76,7 @@ To create the visualizer user interface on the debugger side, you create a class 1. Apply , giving it the visualizer to display (). -#### Special debugger side considerations for .NET 5.0+ +### Special debugger side considerations for .NET 5.0+ Custom Visualizers transfer data between the *debuggee* and *debugger* sides through binary serialization using the class by default. However, that kind of @@ -104,7 +105,7 @@ section to learn what other changes are required on the *debuggee-side* when usi > [!NOTE] > If you would like more information on the issue, see the [BinaryFormatter security guide](/dotnet/standard/serialization/binaryformatter-security-guide). -### To create the visualizer object source for the debuggee side +## Create the visualizer object source for the debuggee side In the debugger side code, edit the , giving it the type to visualize (the debuggee-side object source) (). The `Target` property sets the object source. If you omit the object source, the visualizer will use a default object source. @@ -112,7 +113,7 @@ The debuggee side code contains the object source that gets visualized. The data In the debuggee-side code: -- To let the visualizer edit data objects, the object source must inherit from from and override the `TransferData` or `CreateReplacementObject` methods. +- To let the visualizer edit data objects, the object source must inherit from and override the `TransferData` or `CreateReplacementObject` methods. - If you need to support multi-targeting in your visualizer, you can use the following Target Framework Monikers (TFMs) in the debuggee-side project file. @@ -122,7 +123,7 @@ In the debuggee-side code: These are the only supported TFMs. -#### Special debuggee side considerations for .NET 5.0+ +### Special debuggee side considerations for .NET 5.0+ > [!IMPORTANT] > Additional steps might be needed for a visualizer to work starting in .NET 5.0 due to security concerns regarding the underlying binary @@ -140,7 +141,7 @@ it returns helps to determine the object's serialization format (binary or JSON) - [Walkthrough: Write a visualizer in C#](../debugger/walkthrough-writing-a-visualizer-in-csharp.md) - [Walkthrough: Write a visualizer in Visual Basic](../debugger/walkthrough-writing-a-visualizer-in-visual-basic.md) -- [How to: Install a visualizer](../debugger/how-to-install-a-visualizer.md) -- [How to: Test and debug a visualizer](../debugger/how-to-test-and-debug-a-visualizer.md) +- [Install a visualizer](../debugger/how-to-install-a-visualizer.md) +- [Test and debug a visualizer](../debugger/how-to-test-and-debug-a-visualizer.md) - [Visualizer API reference](../debugger/visualizer-api-reference.md) - [View data in the debugger](../debugger/viewing-data-in-the-debugger.md) diff --git a/docs/debugger/dataset-visualizer-dialog-box.md b/docs/debugger/dataset-visualizer-dialog-box.md index 1e71298560a..1e5299bab90 100644 --- a/docs/debugger/dataset-visualizer-dialog-box.md +++ b/docs/debugger/dataset-visualizer-dialog-box.md @@ -36,6 +36,6 @@ The DataSet Visualizer allows you to view the contents of a DataSet, DataTable, ## See also - [Debugger Security](../debugger/debugger-security.md) -- [Create Custom Visualizers](../debugger/create-custom-visualizers-of-data.md) +- [Create Custom Visualizers for .NET objects](../debugger/create-custom-visualizers-of-data.md) - [Debugger Windows](../debugger/debugger-windows.md) - [View data values in Data Tips](../debugger/view-data-values-in-data-tips-in-the-code-editor.md) \ No newline at end of file diff --git a/docs/debugger/how-to-test-and-debug-a-visualizer.md b/docs/debugger/how-to-test-and-debug-a-visualizer.md index 2d30ac0bd88..60ffac6b5a8 100644 --- a/docs/debugger/how-to-test-and-debug-a-visualizer.md +++ b/docs/debugger/how-to-test-and-debug-a-visualizer.md @@ -57,4 +57,4 @@ An easier way to debug a visualizer is to run the visualizer from a test driver. ## See also - [Walkthrough: Writing a Visualizer in C#](../debugger/walkthrough-writing-a-visualizer-in-csharp.md) - [How to: Install a Visualizer](../debugger/how-to-install-a-visualizer.md) -- [Create Custom Visualizers](../debugger/create-custom-visualizers-of-data.md) +- [Create Custom Visualizers for .NET objects](../debugger/create-custom-visualizers-of-data.md) diff --git a/docs/debugger/how-to-use-the-wpf-tree-visualizer.md b/docs/debugger/how-to-use-the-wpf-tree-visualizer.md index 015d07c8f90..7f6f5488dc1 100644 --- a/docs/debugger/how-to-use-the-wpf-tree-visualizer.md +++ b/docs/debugger/how-to-use-the-wpf-tree-visualizer.md @@ -62,6 +62,6 @@ You can use the WPF Tree visualizer to explore the visual tree of a WPF object, - Click the **Close** icon in the upper-right corner of the dialog box. ## See also -- [Create Custom Visualizers](../debugger/create-custom-visualizers-of-data.md) +- [Create Custom Visualizers for .NET objects](../debugger/create-custom-visualizers-of-data.md) - [Trees in WPF](/dotnet/framework/wpf/advanced/trees-in-wpf) - [Dependency Properties Overview](/dotnet/framework/wpf/advanced/dependency-properties-overview) diff --git a/docs/debugger/toc.yml b/docs/debugger/toc.yml index b2e048dbf32..1b7ccf0a338 100644 --- a/docs/debugger/toc.yml +++ b/docs/debugger/toc.yml @@ -72,7 +72,7 @@ href: view-data-values-in-data-tips-in-the-code-editor.md - name: View string values in a visualizer href: view-strings-visualizer.md - - name: View .NET collections with the IEnumerable visualizer + - name: View .NET collections in a tabular visualizer href: view-data-in-tabular-visualizer.md - name: Disassembly code items: @@ -188,7 +188,7 @@ href: using-debuggertypeproxy-attribute.md - name: Custom visualizers items: - - name: Create custom visualizers of data + - name: Create custom visualizers of data (.NET) href: create-custom-visualizers-of-data.md - name: Visualizer architecture href: visualizer-architecture.md diff --git a/docs/debugger/view-data-values-in-data-tips-in-the-code-editor.md b/docs/debugger/view-data-values-in-data-tips-in-the-code-editor.md index 09de99973f4..3555137db23 100644 --- a/docs/debugger/view-data-values-in-data-tips-in-the-code-editor.md +++ b/docs/debugger/view-data-values-in-data-tips-in-the-code-editor.md @@ -116,7 +116,7 @@ You can also toggle property names and filter out non-pinned properties when vie ## Visualize complex data types -A magnifying glass icon next to a variable or element in a data tip means that one or more [visualizers](../debugger/create-custom-visualizers-of-data.md), such as the [Text Visualizer](../debugger/string-visualizer-dialog-box.md), are available for the variable. Visualizers display information in a more meaningful, sometimes graphical, manner. +A magnifying glass icon next to a variable or element in a data tip means that one or more visualizers, such as the [Text Visualizer](../debugger/string-visualizer-dialog-box.md), are available for the variable. Visualizers display information in a more meaningful, sometimes graphical, manner. To view the element using the default visualizer for the data type, select the magnifying glass icon ![Visualizer icon](../debugger/media/dbg-tips-visualizer-icon.png "Visualizer icon"). Select the arrow next to the magnifying glass icon to select from a list of visualizers for the data type. @@ -148,4 +148,4 @@ You can export data tips to an XML file, which you can share or edit using a tex - [First look at debugging](../debugger/debugger-feature-tour.md) - [Viewing Data in the Debugger](../debugger/viewing-data-in-the-debugger.md) - [Watch and QuickWatch Windows](../debugger/watch-and-quickwatch-windows.md) -- [Create Custom Visualizers](../debugger/create-custom-visualizers-of-data.md) +- [Create Custom Visualizers for .NET objects](../debugger/create-custom-visualizers-of-data.md) diff --git a/docs/debugger/viewing-data-in-the-debugger.md b/docs/debugger/viewing-data-in-the-debugger.md index 289835d6b7a..b59b59298a0 100644 --- a/docs/debugger/viewing-data-in-the-debugger.md +++ b/docs/debugger/viewing-data-in-the-debugger.md @@ -1,7 +1,7 @@ --- title: "Create custom views of data in the debugger | Microsoft Docs" description: Learn the various ways to inspect and modify program state in Visual Studio debugger. These include the Autos and Watch windows, DataTips, and Visualizers. -ms.date: "01/09/2019" +ms.date: "08/08/2023" ms.topic: "conceptual" dev_langs: - "CSharp" @@ -28,11 +28,14 @@ The [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)] debugger provides ## Create custom views of data in variable windows and DataTips - Many of the [debugger windows](../debugger/debugger-windows.md), such as the **Autos** and **Watch** windows, allow you to inspect variables. You can customize how C++ types, managed objects, and your own types are shown in the debugger variable windows and in [DataTips](../debugger/view-data-values-in-data-tips-in-the-code-editor.md). For more information, see [Create custom views of C++ objects](../debugger/create-custom-views-of-native-objects.md) and [Create custom views of managed objects](../debugger/create-custom-views-of-managed-objects.md). + Many of the [debugger windows](../debugger/debugger-windows.md), such as the **Autos** and **Watch** windows, allow you to inspect variables. You can customize how C++ types, managed objects, and your own types are shown in the debugger variable windows and in [DataTips](../debugger/view-data-values-in-data-tips-in-the-code-editor.md). For more information, see [Create custom views of C++ objects](../debugger/create-custom-views-of-native-objects.md) and [Create custom views of .NET objects](../debugger/create-custom-views-of-managed-objects.md). ## Create custom visualizers - Visualizers enable you to view the contents of an object or variable in a meaningful way. In the Visual Studio debugger, a visualizer refers to the different windows that you can open using the magnifying glass ![VisualizerIcon](../debugger/media/dbg-tips-visualizer-icon.png "Visualizer icon") icon. For example, the HTML visualizer shows how an HTML string would be interpreted and displayed in a browser. You can access visualizers from DataTips, the **Watch** window, the **Autos** window, and the **Locals** window. The **QuickWatch** dialog box also provides a visualizer. For more information, see [Create custom visualizers](../debugger/create-custom-visualizers-of-data.md). + Visualizers enable you to view the contents of an object or variable in a meaningful way. In the Visual Studio debugger, a visualizer refers to the different windows that you can open using the magnifying glass ![VisualizerIcon](../debugger/media/dbg-tips-visualizer-icon.png "Visualizer icon") icon. For example, the HTML visualizer shows how an HTML string would be interpreted and displayed in a browser. You can access visualizers from DataTips, the **Watch** window, the **Autos** window, and the **Locals** window. The **QuickWatch** dialog box also provides a visualizer. For more information: + +- To create a visualizer for .NET objects, see [Custom visualizers](../debugger/create-custom-visualizers-of-data.md). +- To create a visualizer for C/C++ objects, see [UIVisualizer element](../debugger/create-custom-views-of-native-objects.md#BKMK_UIVisualizer) within the [Natvis](../debugger/create-custom-views-of-native-objects.md) documentation. Also, see the [C/C++ custom visualizer sample](https://github.com/Microsoft/ConcordExtensibilitySamples/tree/master/CppCustomVisualizer) or the [SQLite native Debugger Visualizer](https://github.com/Microsoft/VSSDK-Extensibility-Samples/tree/master/SqliteVisualizer) sample. ## See also diff --git a/docs/debugger/visualizer-api-reference.md b/docs/debugger/visualizer-api-reference.md index eae5d88231c..16641072ccf 100644 --- a/docs/debugger/visualizer-api-reference.md +++ b/docs/debugger/visualizer-api-reference.md @@ -49,5 +49,4 @@ The Visualizer APIs are provided for users who want to write a visualizer for th ## See also - [Walkthrough: Writing a Visualizer in C#](../debugger/walkthrough-writing-a-visualizer-in-csharp.md) -- [How to: Write a Visualizer](create-custom-visualizers-of-data.md) - [Create Custom Visualizers](../debugger/create-custom-visualizers-of-data.md) \ No newline at end of file diff --git a/docs/debugger/visualizer-architecture.md b/docs/debugger/visualizer-architecture.md index 7bebbd308c7..7b106f47837 100644 --- a/docs/debugger/visualizer-architecture.md +++ b/docs/debugger/visualizer-architecture.md @@ -84,7 +84,7 @@ The architecture of a debugger visualizer has two parts: |

—or—

|| ## See also -- [How to: Write a Visualizer](create-custom-visualizers-of-data.md) +- [Create custom visualizers for .NET objects](create-custom-visualizers-of-data.md) - [Walkthrough: Writing a Visualizer in C#](../debugger/walkthrough-writing-a-visualizer-in-csharp.md) - [Walkthrough: Writing a Visualizer in Visual Basic](../debugger/walkthrough-writing-a-visualizer-in-visual-basic.md) - [Walkthrough: Writing a Visualizer in Visual Basic](../debugger/walkthrough-writing-a-visualizer-in-visual-basic.md) diff --git a/docs/debugger/visualizer-security-considerations.md b/docs/debugger/visualizer-security-considerations.md index c841ca7b082..f1d1ae0f288 100644 --- a/docs/debugger/visualizer-security-considerations.md +++ b/docs/debugger/visualizer-security-considerations.md @@ -42,6 +42,5 @@ Debugger visualizers require greater privileges than are allowed by a partial tr ## See also - [Visualizer Architecture](../debugger/visualizer-architecture.md) -- [How to: Write a Visualizer](create-custom-visualizers-of-data.md) -- [Create Custom Visualizers](../debugger/create-custom-visualizers-of-data.md) +- [Create custom visualizers for .NET objects](../debugger/create-custom-visualizers-of-data.md) - [Viewing Data in the Debugger](../debugger/viewing-data-in-the-debugger.md) \ No newline at end of file diff --git a/docs/ide/creating-solutions-and-projects.md b/docs/ide/creating-solutions-and-projects.md index 50e1df601fb..5c571bbd98b 100644 --- a/docs/ide/creating-solutions-and-projects.md +++ b/docs/ide/creating-solutions-and-projects.md @@ -1,7 +1,7 @@ --- title: "Create projects & solutions" description: Learn how to create and use Visual Studio solutions and projects to store artifacts. -ms.date: 06/16/2023 +ms.date: 08/08/2023 ms.topic: how-to f1_keywords: - vs.openprojectfromweb @@ -60,6 +60,14 @@ If you have a file that applies to multiple projects, such as a readme file for > [!TIP] > A solution file is a structure for organizing projects in Visual Studio. It contains the state of that information in two files: an *.sln* (text-based, shared) file, and an *.suo* (binary, hidden, user-specific solution options) file. Thus, a solution isn't something that should be copied and renamed; instead, it's best to create a new solution and then add existing items to it. +::: moniker range=">=vs-2022" + +### Compare files + +Starting with [version 17.7](/visualstudio/releases/2022/release-notes), you can compare files in Solution Explorer by using the right-click context menu options. For more information, see the [**File comparison**](use-solution-explorer.md#file-comparison) section of the [Learn about Solution Explorer](use-solution-explorer.md) page. + +::: moniker-end + ## Create a .NET project that targets a specific version of the .NET Framework When you create a .NET Framework project, you can specify a specific version of the .NET Framework that you want the project to use. (When you create a .NET Core project, you don't specify a framework version.) diff --git a/docs/ide/csharp-developer-productivity.md b/docs/ide/csharp-developer-productivity.md index 2fbe915faa4..bcc5238b373 100644 --- a/docs/ide/csharp-developer-productivity.md +++ b/docs/ide/csharp-developer-productivity.md @@ -5,7 +5,7 @@ author: TerryGLee ms.author: tglee manager: jmartens ms.technology: vs-ide-general -ms.date: 12/23/2022 +ms.date: 08/08/2023 ms.topic: conceptual helpviewer_keywords: - editor @@ -134,9 +134,9 @@ You can use an EditorConfig file to codify coding conventions and have them trav ::: moniker-end -- The [**code inference feature**](/visualstudio/intellicode/code-style-inference) of [IntelliCode](/visualstudio/intellicode/overview) for Visual Studio infers your code styles from existing code. It then creates a non-empty EditorConfig file with your code-style preferences already defined. +- The [**code inference feature**](/visualstudio/intellicode/code-style-inference) of [IntelliCode](/visualstudio/intellicode/overview) for Visual Studio infers your code styles from existing code. It then creates a nonempty EditorConfig file with your code-style preferences already defined. -- Configure the severity level of a code style rule directly through the editor. If you currently do not have an .editorconfig file, Visual Studio generates one for you. Place your cursor on the error, warning, or suggestion and type **Ctrl**+**.** to open the **Quick Actions and Refactorings** menu. Select **Configure or Suppress issues**. Then select the rule and choose the severity level you would like to configure for that rule. This will update your existing EditorConfig with the rule’s new severity. +- Configure the severity level of a code style rule directly through the editor. If you don't have an .editorconfig file, Visual Studio generates one for you. Place your cursor on the error, warning, or suggestion and type **Ctrl**+**.** to open the **Quick Actions and Refactorings** menu. Select **Configure or Suppress issues**. Then select the rule and choose the severity level you would like to configure for that rule. This action updates your existing EditorConfig with the rule’s new severity. ::: moniker range="vs-2022" @@ -206,7 +206,7 @@ For more information, see [code generation features](code-generation-in-visual-s You can [install .NET analyzers](../code-quality/install-net-analyzers.md) to flag code issues. Or, write your own refactoring or code fix with [Roslyn analyzers](../code-quality/install-roslyn-analyzers.md). -Several community members have written free extensions that add additional code inspections: +Several community members have written free extensions that add more code inspections: ::: moniker range="vs-2022" @@ -269,7 +269,7 @@ For more information, see [Unit test basics](../test/unit-test-basics.md). ## Debugging -Some of Visual Studio's debugging capabilities include the following: +Visual Studio includes the following debugging capabilities: - The ability to search for a string within the **Watch**, **Autos**, and **Locals** windows. - *Run to click*, which lets you hover next to a line of code, hit the green 'play' icon that appears, and run your program until it reaches that line. @@ -323,10 +323,11 @@ Here's a list of editor and productivity features to make writing code more effi | Add usings for types in reference assemblies and NuGet packages | Shows an error light bulb with a code fix to install a NuGet package for an unreferenced type | **Tools** > **Options** > **Text Editor** > **C#** > **Advanced** > **Suggest usings for types in reference assemblies** and **Suggest usings for types in NuGet packages** | | Enable full solution analysis | See all errors in your solution in the **Error List** | **Tools** > **Options** > **Text Editor** > **C#** > **Advanced** > **Enable full solution analysis** | | Enable navigation to decompiled sources | Allow Go To Definition on types/members from external sources and use the ILSpy decompiler to show method bodies | **Tools** > **Options** > **Text Editor** > **C#** > **Advanced** > **Enable navigation to decompiled sources** | -| Completion/Suggestion Mode | Changes the completion behavior in [IntelliSense](using-intellisense.md). Developers with IntelliJ backgrounds tend to use a non-default setting here. | **Edit** > **IntelliSense** > **Toggle Completion Mode** (or press **Ctrl**+**Alt**+**Space** in the editor) | +| Completion/Suggestion Mode | Changes the completion behavior in [IntelliSense](using-intellisense.md). Developers with IntelliJ backgrounds tend to use a nondefault setting here. | **Edit** > **IntelliSense** > **Toggle Completion Mode** (or press **Ctrl**+**Alt**+**Space** in the editor) | | [CodeLens](../ide/find-code-changes-and-other-history-with-codelens.md) | Displays code reference information and change history in the editor. (Source control CodeLens indicators aren't available in Visual Studio Community edition.) | **Tools** > **Options** > **Text Editor** > **All Languages** > **CodeLens** | | [Code snippets](../ide/visual-csharp-code-snippets.md) | Help stub out common boilerplate code | Type a snippet name and press **Tab** twice. | | [Paste JSON or XML as classes](reference/paste-json-xml.md) | Copy any JSON or XML text fragment to the clipboard and paste it as strongly typed .NET classes into any C# code file. | **Edit** > **Paste Special** > **Paste JSON As Classes** (or **Paste XML As Classes**) | +| [Copy and trim indentation](writing-code-in-the-code-and-text-editor.md#copy-and-paste-code) | Copy code from Visual Studio to another program (Outlook, Teams, etc.), without having to manually fix indentation after you paste your code. Available in Visual Studio 2022 [version 17.7](/visualstudio/releases/2022/release-notes) and later. | ## See also diff --git a/docs/ide/media/vs-2022/copy-trim-indentation.png b/docs/ide/media/vs-2022/copy-trim-indentation.png new file mode 100644 index 00000000000..2909d665895 Binary files /dev/null and b/docs/ide/media/vs-2022/copy-trim-indentation.png differ diff --git a/docs/ide/productivity-features.md b/docs/ide/productivity-features.md index 0b2dd596dd8..94d4b053032 100644 --- a/docs/ide/productivity-features.md +++ b/docs/ide/productivity-features.md @@ -1,7 +1,7 @@ --- title: Productivity guide description: Learn about the keyboard shortcuts and productivity features in Visual Studio that can help you efficiently write code, debug code, and handle errors. -ms.date: 09/23/2022 +ms.date: 08/08/2023 ms.topic: conceptual author: TerryGLee ms.author: tglee @@ -24,7 +24,7 @@ Save time digging through menus by quickly searching for anything you need, incl - **Mock code using task list**. If you don't have enough requirements to complete a piece of code, use Task List to track code comments that use tokens such as `TODO` and `HACK`, or custom tokens, and to manage shortcuts that take you directly to a predefined location in code. For more information, see [Use the Task List](../ide/using-the-task-list.md). -- **Use Solution Explorer shortcuts**. If you're new to Visual Studio, these shortcuts will come in handy and save you time while you're coming up to speed on a new codebase. For the full list of shortcuts, see [Default keyboard shortcuts in Visual Studio](../ide/default-keyboard-shortcuts-in-visual-studio.md#bkmk_solutionexplorerGLOBAL). +- **Use Solution Explorer shortcuts**. If you're new to Visual Studio, these shortcuts come in handy and save you time while you're coming up to speed on a new codebase. For the full list of shortcuts, see [Default keyboard shortcuts in Visual Studio](../ide/default-keyboard-shortcuts-in-visual-studio.md#bkmk_solutionexplorerGLOBAL). - **[Identify and customize keyboard shortcuts in Visual Studio](../ide/identifying-and-customizing-keyboard-shortcuts-in-visual-studio.md)**. You can identify keyboard shortcuts for Visual Studio commands, customize those shortcuts, and export them for others to use. You can always find and change a keyboard shortcut in the Options dialog box. @@ -64,6 +64,11 @@ Write code more quickly by using the following features. - **Change your indentation with Tabs**. Use custom editor settings, tailored to each codebase, to enforce consistent coding styles for multiple developers working on the same project across different editors and IDEs. Ensure your whole team follows the same language conventions, naming conventions, and formatting rules. Since these custom settings are portable and travel with your code, you can enforce coding styles even outside of Visual Studio. For more information, see [Options, Text Editor, All Languages, Tabs](../ide/reference/options-text-editor-all-languages-tabs.md#tabs). +::: moniker range=">=vs-2022" +- [**Try automatic copy and trim indentation**](writing-code-in-the-code-and-text-editor.md#copy-and-paste-code). Copy code from Visual Studio to another program (Outlook, Teams, etc.), without having to manually fix indentation after you paste your code. Available in Visual Studio 2022 [version 17.7](/visualstudio/releases/2022/release-notes) and later. +::: moniker-end + + ## Navigate within your code and the IDE You can use various techniques to find and move to specific locations in your code more quickly. You can also change the layout of your Visual Studio windows based on your preferences. @@ -102,9 +107,9 @@ You can search across the IDE for commands, files, and options, in addition to f ## Debug code -Debugging can consume a lot of time, but the following tips can help you speed up the process. +Debugging can take time, but the following tips can help you speed up the process. -- **Use the Visual Studio debugger tools**. In the Visual Studio context, when you *debug your app*, it usually means that you are running the application in debugger mode. The debugger provides many ways to see what your code is doing while it runs. See [First look at the Visual Studio Debugger](../debugger/debugger-feature-tour.md) for a guide to getting started. +- **Use the Visual Studio debugger tools**. In the Visual Studio context, when you *debug your app*, it usually means that you're running the application in debugger mode. The debugger provides many ways to see what your code is doing while it runs. See [First look at the Visual Studio Debugger](../debugger/debugger-feature-tour.md) for a guide to getting started. - **Set temporary breakpoints**. You can create a temporary breakpoint in the current line of code and start the debugger simultaneously. When you hit that line of code, the debugger enters break mode. For more information, see [Navigate through code with the debugger](../debugger/navigating-through-code-with-the-debugger.md). @@ -120,7 +125,7 @@ Debugging can consume a lot of time, but the following tips can help you speed u - **Clear the Immediate window**. You can erase the contents of the [Immediate window](../ide/reference/immediate-window.md) at design time by entering `>cls` or `>Edit.ClearAll` - For more information about additional commands, see [Visual Studio command aliases](../ide/reference/visual-studio-command-aliases.md). + For more information about other commands, see [Visual Studio command aliases](../ide/reference/visual-studio-command-aliases.md). - **[Find code changes and other history with CodeLens](../ide/find-code-changes-and-other-history-with-codelens.md)**. CodeLens lets you stay focused on your work while you find out what happened to your code—without leaving the editor. You can find references to a piece of code, changes to your code, linked bugs, work items, code reviews, and unit tests. @@ -155,5 +160,5 @@ At any one time, you may be working in multiple code files and moving among seve - [Visual Studio tips and tricks blog post](https://devblogs.microsoft.com/visualstudio/visual-studio-tips-and-tricks/) - [Default keyboard shortcuts for frequently used commands](default-keyboard-shortcuts-in-visual-studio.md) - [How to: Customize menus and toolbars](../ide/how-to-customize-menus-and-toolbars-in-visual-studio.md) -- [Walkthrough: Create a simple application](../get-started/csharp/tutorial-wpf.md) +- [Walkthrough: Create an application](../get-started/csharp/tutorial-wpf.md) - [Accessibility tips and tricks](../ide/reference/accessibility-tips-and-tricks.md) diff --git a/docs/ide/solutions-and-projects-in-visual-studio.md b/docs/ide/solutions-and-projects-in-visual-studio.md index a992c6f167e..7736b198d0d 100644 --- a/docs/ide/solutions-and-projects-in-visual-studio.md +++ b/docs/ide/solutions-and-projects-in-visual-studio.md @@ -2,7 +2,7 @@ title: 'What are Visual Studio solutions & projects?' description: Learn about Visual Studio projects and solutions, how to create new projects from a template, and how to view & manage projects in Solution Explorer. ms.custom: "contperf-fy21q2" -ms.date: 08/26/2022 +ms.date: 08/08/2023 ms.topic: conceptual f1_keywords: - vs.openproject @@ -84,6 +84,12 @@ The [toolbar](use-solution-explorer.md#solution-explorer-toolbar) across the top Many menu commands are available from the [right-click context menu](use-solution-explorer.md#solution-node-context-menu-options) on various items in **Solution Explorer**. These commands include building a project, managing NuGet packages, adding a reference, renaming a file, and running tests, just to name a few. For more information, see [Learn about Solution Explorer](use-solution-explorer.md). +::: moniker range=">=vs-2022" + +Starting with [version 17.7](/visualstudio/releases/2022/release-notes), you can also compare files in Solution Explorer by using the right-click context menu options. For more information, see the [**File comparison**](use-solution-explorer.md#file-comparison) section of the [Learn about Solution Explorer](use-solution-explorer.md) page. + +::: moniker-end + For ASP.NET Core projects, you can customize how files are nested in **Solution Explorer**. For more information, see [File nesting in Solution Explorer](file-nesting-solution-explorer.md). > [!TIP] diff --git a/docs/ide/whats-new-visual-studio-2022.md b/docs/ide/whats-new-visual-studio-2022.md index 5f881b786a5..95214e181db 100644 --- a/docs/ide/whats-new-visual-studio-2022.md +++ b/docs/ide/whats-new-visual-studio-2022.md @@ -2,7 +2,7 @@ title: "What's new in Visual Studio 2022" titleSuffix: "" description: "Learn about the new features in Visual Studio 2022." -ms.date: 08/18/2023 +ms.date: 08/08/2023 helpviewer_keywords: - "Visual Studio, what's new" - "what's new [Visual Studio]" @@ -124,6 +124,7 @@ Why send feedback to the Visual Studio team? Because we take customer feedback s Review the following blog posts to learn more about the improvements we've made to Visual Studio 2022, to date: +* [Visual Studio 2022 17.7 is now available](https://devblogs.microsoft.com/visualstudio/visual-studio-2022-17-7-now-available/) * [Visual Studio 2022 17.6 is now available](https://devblogs.microsoft.com/visualstudio/visual-studio-2022-17-6-now-available/) * [Visual Studio 2022 17.5 is now available](https://devblogs.microsoft.com/visualstudio/visual-studio-2022-17-5-released/) * [Visual Studio 2022 17.4 is now available](https://devblogs.microsoft.com/visualstudio/visual-studio-2022-17-4/) diff --git a/docs/ide/writing-code-in-the-code-and-text-editor.md b/docs/ide/writing-code-in-the-code-and-text-editor.md index 900c3f913e3..a8b99e12f7f 100644 --- a/docs/ide/writing-code-in-the-code-and-text-editor.md +++ b/docs/ide/writing-code-in-the-code-and-text-editor.md @@ -1,7 +1,7 @@ --- title: Code editor features description: Learn about the features that the code editor in Visual Studio provides to make it easier for you to write and manage your code and text. -ms.date: 01/31/2022 +ms.date: 08/08/2023 ms.topic: conceptual helpviewer_keywords: - code, editing [Visual Studio] @@ -22,11 +22,11 @@ The Visual Studio editor provides many features that make it easier for you to w > [!NOTE] > This topic applies to Visual Studio on Windows. For Visual Studio for Mac, see [Source editor (Visual Studio for Mac)](/visualstudio/mac/source-editor). -You can view your code in a number of different ways. By default, **Solution Explorer** shows your code organized by files. You can click on the **Class View** tab at the bottom of the window to view your code organized by classes. +You can view your code in many different ways. By default, **Solution Explorer** shows your code organized by files. You can select the **Class View** tab at the bottom of the window to view your code organized by classes. You can search and replace text in single or multiple files. For more information, see [Find and replace text](../ide/finding-and-replacing-text.md). You can use regular expressions to find and replace text. For more information, see [Use regular expressions in Visual Studio](../ide/using-regular-expressions-in-visual-studio.md). -The different Visual Studio languages offer different sets of features, and in some cases the features behave differently in different languages. Many of these differences are specified in the descriptions of the features, but for more information you can see the sections on specific Visual Studio languages. +The different Visual Studio languages offer different sets of features, and in some cases the features behave differently in different languages. Many of these differences are specified in the descriptions of the features, but for more information, see the sections on specific Visual Studio languages. ## Editor features @@ -35,27 +35,27 @@ The different Visual Studio languages offer different sets of features, and in s |Syntax Coloring|Some syntax elements of code and markup files are colored differently to distinguish them. For example, keywords (such as `using` in C# and `Imports` in Visual Basic) are one color, but types (such as `Console` and `Uri`) are another color. Other syntax elements are also colorized, such as string literals and comments. C++ uses color to differentiate among types, enumerations, and macros, among other tokens.

You can see the default color for each type, and you can change the color for any specific syntax element in the [Fonts and Colors, Environment, Options dialog box](../ide/reference/fonts-and-colors-environment-options-dialog-box.md), which you can open from the **Tools** menu.| |Error and Warning Marks|As you add code and build your solution, you may see (a) different-colored wavy underlines (known as squiggles) or (b) light bulbs appearing in your code. Red squiggles denote syntax errors, blue denotes compiler errors, green denotes warnings, and purple denotes other types of errors. [Quick Actions](../ide/quick-actions.md) suggest fixes for problems and make it easy to apply the fix.

You can see the default color for each error and warning squiggle in the **Tools** > **Options** > **Environment** > **Fonts and Colors** dialog box. Look for **Syntax Error**, **Compiler Error**, **Warning**, and **Other Error**.| |Brace Matching|When the insertion point is placed on an open brace in a code file, both it and the closing brace are highlighted. This feature gives you immediate feedback on misplaced or missing braces. You can turn brace matching on or off with the **Automatic Delimiter Highlighting** setting (**Tools** > **Options** > **Text Editor**). You can change the highlight color in the **Fonts and Colors** setting (**Tools** > **Options** > **Environment**). Look for **Brace Matching (Highlight)** or **Brace Matching (Rectangle)**.| -|Structure Visualizer|Dotted lines connect matching braces in code files, making it easier to see opening and closing brace pairs. This can help you find code in your codebase more quickly. You can turn these lines on or off with the **Show structure guidelines** in the **Display** section of the **Tools** > **Options** > **Text Editor** > **General** page.| -|Line Numbers|Line numbers can be displayed in the left margin of the code window. They are not displayed by default. You can turn this option on in the **Text Editor All Languages** settings (**Tools** > **Options** > **Text Editor** > **All Languages**). You can display line numbers for individual programming languages by changing the settings for those languages (**Tools** > **Options** > **Text Editor** > **\**). For line numbers to print, you must select **Include line numbers** in the **Print** dialog box.| -|Change Tracking|The color of the left margin allows you to keep track of the changes you have made in a file. Changes you have made since the file was opened but not saved are denoted by a yellow bar on the left margin (known as the selection margin). After you have saved the changes (but before closing the file), the bar turns green. If you undo a change after you have saved the file, the bar turns orange. To turn this feature off and on, change the **Track changes** option in the **Text Editor** settings (**Tools** > **Options** > **Text Editor**).| +|Structure Visualizer|Dotted lines connect matching braces in code files, making it easier to see opening and closing brace pairs. This feature can help you find code in your codebase more quickly. You can turn these lines on or off with the **Show structure guidelines** in the **Display** section of the **Tools** > **Options** > **Text Editor** > **General** page.| +|Line Numbers|Line numbers can be displayed in the left margin of the code window. They aren't displayed by default. You can turn on this option in the **Text Editor All Languages** settings (**Tools** > **Options** > **Text Editor** > **All Languages**). You can display line numbers for individual programming languages by changing the settings for those languages (**Tools** > **Options** > **Text Editor** > **\**). For line numbers to print, you must select **Include line numbers** in the **Print** dialog box.| +|Change Tracking|The color of the left margin allows you to keep track of the changes you have made in a file. Changes you've made since the file was opened but not saved are denoted by a yellow bar on the left margin (known as the selection margin). After you have saved the changes (but before closing the file), the bar turns green. If you undo a change after you have saved the file, the bar turns orange. To turn this feature off and on, change the **Track changes** option in the **Text Editor** settings (**Tools** > **Options** > **Text Editor**).| |Selecting Code and Text|You can select text either in the standard continuous stream mode or in box mode, in which you select a rectangular portion of text instead of a set of lines. To make a selection in box mode, press **Alt** as you drag the mouse over the selection (or press **Alt**+**Shift**+**\**). The selection includes all of the characters within the rectangle defined by the first character and the last character in the selection. Anything typed or pasted into the selected area is inserted at the same point on each line.| -|Zoom|You can zoom in or out in any code window by pressing and holding the **Ctrl** key and moving the scroll wheel on the mouse (or **Ctrl**+**Shift**+**.** to increase and **Ctrl**+**Shift**+**,** to decrease). You can also use the **Zoom** box in the lower left corner of the code window to set a specific zoom percentage. The zoom feature does not work in tool windows.| -|Virtual Space|By default, lines in Visual Studio editors end after the last character, so that the **Right Arrow** key at the end of a line moves the cursor to the beginning of the next line. In some other editors a line does not end after the last character, and you can place your cursor anywhere on the line. You can enable virtual space in the editor in the **Tools** > **Options** > **Text Editor** > **All Languages** settings. Note that you can enable either **Virtual Space** or **Word Wrap**, but not both.| +|Zoom|You can zoom in or out in any code window by pressing and holding the **Ctrl** key and moving the scroll wheel on the mouse (or **Ctrl**+**Shift**+**.** to increase and **Ctrl**+**Shift**+**,** to decrease). You can also use the **Zoom** box in the lower left corner of the code window to set a specific zoom percentage. The zoom feature doesn't work in tool windows.| +|Virtual Space|By default, lines in Visual Studio editors end after the last character, so that the **Right Arrow** key at the end of a line moves the cursor to the beginning of the next line. In some other editors, a line doesn't end after the last character and you can place your cursor anywhere on the line. You can enable virtual space in the editor in the **Tools** > **Options** > **Text Editor** > **All Languages** settings. You can enable either **Virtual Space** or **Word Wrap**, but not both.| |Printing|You can use the options in the **Print** dialog box to include line numbers or hide collapsed regions of code when you print a file. In the **Page Setup** dialog box, you can also choose to print the full path and the name of the file by choosing **Page header**.

You can set color printing options in the **Tools** > **Options** > **Environment** > **Fonts and Colors** dialog box. Choose **Printer** in the **Show settings for** list to customize color printing. You can specify different colors for printing a file than for editing a file.| |Global Undo and Redo|The **Undo Last Global Action** and **Redo Last Global Action** commands on the **Edit** menu undo or redo global actions that affect multiple files. Global actions include renaming a class or namespace, performing a find-and-replace operation across a solution, refactoring a database, or any other action that changes multiple files. You can apply the global undo and redo commands to actions in the current Visual Studio session, even after you close the solution in which an action was applied.| ## Advanced editing features -You can find a number of advanced features on the **Edit** > **Advanced** menu on the toolbar. Not all of these features are available for all types of code files. +You can find many advanced features on the **Edit** > **Advanced** menu on the toolbar. Not all of these features are available for all types of code files. |Feature|Description| |-|-| |Format Document|Sets the proper indentation of lines of code and moves curly braces to separate lines in the document.| |Format Selection|Sets the proper indentation of lines of code and moves curly braces to separate lines in the selection.| |Tabify Selected Lines|Changes leading spaces to tabs where appropriate.| -|Untabify Selected Lines|Changes leading tabs to spaces. If you want to convert all the spaces in your file to tabs (or all the tabs to spaces), you can use the `Edit.ConvertSpacesToTabs` and `Edit.ConvertTabsToSpaces` commands. These commands do not appear in Visual Studio menus, but you can call them from the **Quick Access** window or the command window.| -|Make Uppercase|Changes all characters in the selection to uppercase, or if there is no selection, changes the character at the insertion point to uppercase. Shortcut: **Ctrl**+**Shift**+**U**.| -|Make Lowercase|Changes all characters in the selection to lowercase, or if there is no selection, changes the character at the insertion point to lowercase. Shortcut: **Ctrl**+**U**.| +|Untabify Selected Lines|Changes leading tabs to spaces. If you want to convert all the spaces in your file to tabs (or all the tabs to spaces), you can use the `Edit.ConvertSpacesToTabs` and `Edit.ConvertTabsToSpaces` commands. These commands don't appear in Visual Studio menus, but you can call them from the **Quick Access** window or the command window.| +|Make Uppercase|Changes all characters in the selection to uppercase, or if there's no selection, changes the character at the insertion point to uppercase. Shortcut: **Ctrl**+**Shift**+**U**.| +|Make Lowercase|Changes all characters in the selection to lowercase, or if there's no selection, changes the character at the insertion point to lowercase. Shortcut: **Ctrl**+**U**.| |Move selected Lines Up|Moves the selected line up one line. Shortcut: **Alt**+**Up Arrow**.| |Move Selected Lines Down|Moves the selected line down one line. Shortcut: **Alt**+**Down Arrow**.| |Delete Horizontal White Space|Deletes tabs or spaces at the end of the current line. Shortcut: **Ctrl**+**K**, **Ctrl**+**\\**| @@ -70,13 +70,13 @@ You can find a number of advanced features on the **Edit** > **Advanced** menu o ## Navigate and find code -You can move around in the code editor in several different ways, including navigating backwards and forwards to previous insertion points, viewing the definition of a type or member, and jumping to a specific method using the navigation bar. For more information see [Navigate code](navigating-code.md). +You can move around in the code editor in several different ways, including navigating backwards and forwards to previous insertion points, viewing the definition of a type or member, and jumping to a specific method using the navigation bar. For more information, see [Navigate code](navigating-code.md). You can also set bookmarks to mark lines in your code so that you can quickly return to a specific location, or jump back and forth between locations. To learn more, see [Bookmark code](setting-bookmarks-in-code.md). ## Find references in your code base -To find where particular code elements are referenced throughout your codebase, you can use the **Find All References** command or press **Shift**+**F12**. Also, when you click on a type or member, the **reference highlighting** feature automatically highlights all references to that type or member. For more information, see [Find references in your code](finding-references.md). +To find where particular code elements are referenced throughout your codebase, you can use the **Find All References** command or press **Shift**+**F12**. Also, when you select a type or member, the **reference highlighting** feature automatically highlights all references to that type or member. For more information, see [Find references in your code](finding-references.md). ## Generate, fix, or refactor code @@ -86,7 +86,21 @@ There are numerous ways that Visual Studio can help you generate, fix, and refac - You can use [Quick Actions](quick-actions.md) to generate code such as classes and properties, or to introduce a local variable. You can also use Quick Actions to [improve code](common-quick-actions.md), for example to remove unnecessary casts and unused variables, or to add null checks before accessing variables. -- You can [refactor code](refactoring-in-visual-studio.md) to rename a variable, re-order method parameters, or synchronize a type with its filename, to name a few. +- You can [refactor code](refactoring-in-visual-studio.md) to rename a variable, reorder method parameters, or synchronize a type with its filename, to name a few. + +::: moniker range=">=vs-2022" + +## Copy and paste code + +Visual Studio offers a few time-savers when it comes to copying and pasting code, as follows: + +- **Copy and trim indentation**: Starting with [version 17.7](/visualstudio/releases/2022/release-notes), Visual Studio automatically fixes code indentation when you copy the code from Visual Studio and paste it into another application. + + :::image type="content" source="media/vs-2022/copy-trim-indentation.png" alt-text="Screenshot that shows a before and after comparison to highlight the Copy and Trim Indentation feature."::: + +- **[Paste JSON or XML as classes](reference/paste-json-xml.md)**. Copy any JSON or XML text fragment to the clipboard and then paste it as strongly typed .NET classes into any C# or Visual Basic code file. To do so, use **Edit** > **Paste Special** > **Paste JSON As Classes** (or **Paste XML As Classes**). + +::: moniker-end ## Customize the editor diff --git a/docs/javascript/TOC.yml b/docs/javascript/TOC.yml index c6d39c2b55a..a7bac538ba6 100644 --- a/docs/javascript/TOC.yml +++ b/docs/javascript/TOC.yml @@ -14,7 +14,7 @@ href: tutorial-create-angular-app.md - name: Create a Vue.js app href: tutorial-create-vue-app.md - - name: Create a Vue.js project + - name: Create a Vue.js app (.njsproj) href: quickstart-vuejs-with-nodejs.md - name: Tutorials items: @@ -54,7 +54,7 @@ href: npm-package-management.md - name: Develop without projects or solutions ("Open Folder") href: develop-javascript-code-without-solutions-projects.md - - name: Create a Vue.js application + - name: Create a Vue.js application (.njsproj) href: create-application-with-vuejs.md - name: Use the Node.js interactive REPL href: nodejs-interactive-repl.md diff --git a/docs/javascript/create-application-with-vuejs.md b/docs/javascript/create-application-with-vuejs.md index a95186c200c..176f8d2d0e1 100644 --- a/docs/javascript/create-application-with-vuejs.md +++ b/docs/javascript/create-application-with-vuejs.md @@ -13,7 +13,7 @@ dev_langs: - JavaScript ms.workload: - "nodejs" -monikerRange: 'vs-2019' +monikerRange: '=vs-2019' --- # Create a Vue.js application using Node.js Tools for Visual Studio @@ -37,7 +37,7 @@ The following new features support Vue.js application development in Visual Stud > [!IMPORTANT] > This article requires features that are only available starting in Visual Studio 2017 version 15.8. - If a required version is not already installed, install [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/?cid=learn-onpage-download-cta). + If a required version isn't already installed, install [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/?cid=learn-onpage-download-cta). If you need to install the workload but already have Visual Studio, go to **Tools** > **Get Tools and Features...**, which opens the Visual Studio Installer. Choose the **Node.js development** workload, then choose **Modify**. @@ -45,7 +45,7 @@ The following new features support Vue.js application development in Visual Stud * You must have the Node.js runtime installed. - If you don't have it installed, install the LTS version from the [Node.js](https://nodejs.org/en/download/) website. In general, Visual Studio automatically detects the installed Node.js runtime. If it does not detect an installed runtime, you can configure your project to reference the installed runtime in the properties page. (After you create a project, right-click the project node and choose **Properties**). + If you don't have it installed, install the LTS version from the [Node.js](https://nodejs.org/en/download/) website. In general, Visual Studio automatically detects the installed Node.js runtime. If it doesn't detect an installed runtime, you can configure your project to reference the installed runtime in the properties page. (After you create a project, right-click the project node and choose **Properties**). ## Create a Vue.js project using Node.js @@ -60,13 +60,13 @@ Vue.js provides an official CLI for quickly scaffolding projects. If you would l ### Create a new ASP.NET Core project -For this example, you use an empty ASP.NET Core Application (C#). However, you can choose from a variety of projects and programming languages. +For this example, you use an empty ASP.NET Core Application (C#). However, you can choose from various projects and programming languages. #### Create an Empty project * Open Visual Studio and create a new project. - In Visual Studio 2019, choose **Create a new project** in the start window. If the start window is not open, choose **File** > **Start Window**. Type **web app**, choose **C#** as the language, then choose **ASP.NET Core Empty**, and then choose **Next**. On the next screen, name the project **client-app**, and then choose **Next**. + In Visual Studio 2019, choose **Create a new project** in the start window. If the start window isn't open, choose **File** > **Start Window**. Type **web app**, choose **C#** as the language, then choose **ASP.NET Core Empty**, and then choose **Next**. On the next screen, name the project **client-app**, and then choose **Next**. Choose either the recommended target framework or .NET 6, and then choose **Create**. @@ -92,9 +92,9 @@ To install the vue-cli npm module, open a command prompt and type `npm install - 1. Type `vue init webpack client-app` and follow steps when prompted to answer additional questions. > [!NOTE] - > For *.vue* files, you need to use WebPack or a similar framework with a loader to do the conversion. TypeScript and Visual Studio does not know how to compile *.vue* files. The same is true for bundling; TypeScript doesn't know how to convert ES2015 modules (that is, `import` and `export` statements) into a single final *.js* file to load in the browser. Again, WebPack is the best choice here. To drive this process from within Visual Studio using MSBuild, you need to do start from a Visual Studio template. At present, there is no ASP.NET template for Vue.js development in-the-box. + > For *.vue* files, you need to use Webpack or a similar framework with a loader to do the conversion. TypeScript and Visual Studio does not know how to compile *.vue* files. The same is true for bundling; TypeScript doesn't know how to convert ES2015 modules (that is, `import` and `export` statements) into a single final *.js* file to load in the browser. Again, Webpack is the best choice here. To drive this process from within Visual Studio using MSBuild, you need to do start from a Visual Studio template. At present, there is no ASP.NET template for Vue.js development in-the-box. -#### Modify the webpack configuration to output the built files to wwwroot +#### Modify the Webpack configuration to output the built files to wwwroot * Open the file *./client-app/config/index.js*, and change the `build.index` and `build.assetsRoot` to wwwroot path: @@ -112,7 +112,7 @@ To install the vue-cli npm module, open a command prompt and type `npm install - 1. On **Pre-build event command line**, type `npm --prefix ./client-app run build`. -#### Configure webpack's output module names +#### Configure Webpack's output module names * Open the file *./client-app/build/webpack.base.conf.js*, and add the following properties to the output property: @@ -154,7 +154,7 @@ These steps require vue-cli 3.0, which is currently in beta. }; ``` - The preceding code configures webpack and sets the wwwroot folder. + The preceding code configures Webpack and sets the wwwroot folder. #### Build with vue-cli 3.0 diff --git a/docs/javascript/quickstart-vuejs-with-nodejs.md b/docs/javascript/quickstart-vuejs-with-nodejs.md index b26706a44e1..8575acf9d34 100644 --- a/docs/javascript/quickstart-vuejs-with-nodejs.md +++ b/docs/javascript/quickstart-vuejs-with-nodejs.md @@ -13,7 +13,7 @@ dev_langs: - JavaScript ms.workload: - "nodejs" -monikerRange: '< vs-2022' +monikerRange: '=vs-2019' --- # Quickstart: Use Visual Studio to create your first Vue.js app diff --git a/docs/test/toc.yml b/docs/test/toc.yml index 909ad10c716..618974815f1 100644 --- a/docs/test/toc.yml +++ b/docs/test/toc.yml @@ -136,11 +136,11 @@ href: live-unit-testing-start.md - name: Configure and use href: live-unit-testing.md - - name: Configure and use + - name: Configure and use (VS 2019) href: live-unit-testing-2019.md - name: FAQ href: live-unit-testing-faq.yml - - name: FAQ + - name: FAQ (VS 2019) href: live-unit-testing-faq-2019.yml - name: Web performance and load testing items: diff --git a/docs/vsto/visual-studio-tools-for-office-runtime.md b/docs/vsto/visual-studio-tools-for-office-runtime.md index e82af46d952..f6a24bf2780 100644 --- a/docs/vsto/visual-studio-tools-for-office-runtime.md +++ b/docs/vsto/visual-studio-tools-for-office-runtime.md @@ -22,9 +22,9 @@ ms.workload: The Visual Studio 2010 Tools for Office Runtime (VSTO Runtime) ships with various versions of Visual Studio and Microsoft Office and follows the support lifecycle of the parent product. -It is also [available to download](https://aka.ms/VSTORuntimeDownload) and install independently. The versions of VSTO Runtime that are available on the download center follow the support lifecycle of the latest version of Microsoft Office that was available at the time of its release. +It's also [available to download](https://aka.ms/VSTORuntimeDownload) and install independently. The versions of VSTO Runtime that are available on the download center follow the support lifecycle of the latest version of Microsoft Office that was available at the time of its release. -It is recommended that developers install the latest version of the VSTO Runtime with their applications. It will be supported when running with supported versions Office. If the VSTO Runtime needs to be serviced, only the latest version will be updated. +It's recommended that developers install the latest version of the VSTO Runtime with their applications. It is supported when running with supported versions Office. If the VSTO Runtime needs to be serviced, only the latest version is updated. The following is a list of the VSTO Runtime releases and the corresponding version of Office for which its support lifecycle follows: @@ -42,6 +42,7 @@ The following is a list of the VSTO Runtime releases and the corresponding versi | 10.0.60715 | 07/20/2015 | Microsoft Office 2016 | | 10.0.60724 | 07/24/2015 | Microsoft Office 2016 | | 10.0.60825 | 11/19/2016 | Microsoft Office 2016 | -| 10.0.60828 | 01/12/2018 | Microsoft Office 2019 /
Office 365 /
Office 2021 | +| 10.0.60828 | 01/12/2018 | Microsoft Office 2019 /
Microsoft Office 2021 /
Office 365 | +| 10.0.60910 | 08/08/2024 | Microsoft Office 2013 /
Microsoft Office 2016 /
Microsoft Office 2019 /
Microsoft Office 2021 /
Office 365 | -For more information on the Office Support Lifecycle please see [Lifecycle FAQ - Office, Office 365, and Microsoft 365](/lifecycle/faq/office). +For more information on the Office Support Lifecycle, see [Lifecycle FAQ - Office, Office 365, and Microsoft 365](/lifecycle/faq/office). diff --git a/subscriptions/faq/admin/benefits/includes/activate-subscriptions.md b/subscriptions/faq/admin/benefits/includes/activate-subscriptions.md index cb97d747300..86ae16c9fe1 100644 --- a/subscriptions/faq/admin/benefits/includes/activate-subscriptions.md +++ b/subscriptions/faq/admin/benefits/includes/activate-subscriptions.md @@ -1,12 +1,13 @@ --- title: How do my end users activate their Visual Studio Subscription? -description: The subscription is active and can be used as soon as it has been assigned from within the Visual Studio Administrator portal. +description: The subscription is active and can be used as soon as it has been assigned from within the Visual Studio Administrator portal. +comment: As of August 2023 this include is used to render marketing FAQ content for VS Subscriptions in the following portals - VSCom, Manage, and My portals. It was not used for learn.microsoft.com content at that time. SMEs are Evan Windom and Larissa Crawford of Red Door Collaborative and Sharvari Dighe. ms.faqid: group2_1 ms.topic: include ms.assetid: 1530ca0a-f23f-44f1-9bde-792ea1265085 author: evanwindom ms.author: amast -ms.date: 02/15/2023 +ms.date: 08/08/2023 --- ## How do my end users activate their Visual Studio subscription? diff --git a/subscriptions/faq/admin/benefits/includes/activate-with-product-keys.md b/subscriptions/faq/admin/benefits/includes/activate-with-product-keys.md index b60005bb303..1f74ef9af7d 100644 --- a/subscriptions/faq/admin/benefits/includes/activate-with-product-keys.md +++ b/subscriptions/faq/admin/benefits/includes/activate-with-product-keys.md @@ -1,12 +1,13 @@ --- title: How do my developers activate software using product keys from their Visual Studio subscription? description: Depending on what product your subscriber has downloaded it can either be activated by logging in using the email address tied to the... +comment: As of August 2023 this include is used to render marketing FAQ content for VS Subscriptions in the following portals - VSCom, Manage, and My portals. It was not used for learn.microsoft.com content at that time. SMEs are Evan Windom and Larissa Crawford of Red Door Collaborative and Sharvari Dighe. ms.faqid: group2_4 ms.topic: include ms.assetid: 248726b6-1e50-481c-aabf-0f509da5d710 author: evanwindom ms.author: amast -ms.date: 02/15/2023 +ms.date: 08/08/2023 --- ## How do my developers activate software using product keys from their Visual Studio subscription? diff --git a/subscriptions/faq/admin/benefits/includes/available-benefits.md b/subscriptions/faq/admin/benefits/includes/available-benefits.md index e99ad9e84bf..9402cb06be9 100644 --- a/subscriptions/faq/admin/benefits/includes/available-benefits.md +++ b/subscriptions/faq/admin/benefits/includes/available-benefits.md @@ -1,12 +1,13 @@ --- title: What benefits and software is available to my subscriber once a Visual Studio subscription has been assigned? description: The Visual Studio Subscription benefits page allows you to see and compare the full list of benefits and software downloads included... +comment: As of August 2023 this include is used to render marketing FAQ content for VS Subscriptions in the following portals - VSCom, Manage, and My portals. It was not used for learn.microsoft.com content at that time. SMEs are Evan Windom and Larissa Crawford of Red Door Collaborative and Sharvari Dighe. ms.faqid: group2_2 ms.topic: include ms.assetid: e8b196c2-6118-47d1-8363-ceae3d9b6fb2 author: evanwindom ms.author: amast -ms.date: 11/10/2020 +ms.date: 08/08/2023 --- ## What benefits and software are available to my subscribers after a Visual Studio subscription has been assigned? diff --git a/subscriptions/faq/admin/benefits/includes/azure-dev-test-discount.md b/subscriptions/faq/admin/benefits/includes/azure-dev-test-discount.md index b7afcafe2c4..7328f842c2f 100644 --- a/subscriptions/faq/admin/benefits/includes/azure-dev-test-discount.md +++ b/subscriptions/faq/admin/benefits/includes/azure-dev-test-discount.md @@ -1,12 +1,13 @@ --- title: How do my developers get 50% off Azure Dev/Test workloads? description: If your organization has an Enterprise Agreement for Azure, your developers can choose... +comment: As of August 2023 this include is used to render marketing FAQ content for VS Subscriptions in the following portals - VSCom, Manage, and My portals. It was not used for learn.microsoft.com content at that time. SMEs are Evan Windom and Larissa Crawford of Red Door Collaborative and Sharvari Dighe. ms.faqid: group2_5 ms.topic: include ms.assetid: 86308cf3-909b-47a0-9230-5d1a93a2f87a author: evanwindom ms.author: amast -ms.date: 05/03/2021 +ms.date: 08/08/2023 --- ## How do my developers get 50% off Azure dev/test workloads? diff --git a/subscriptions/faq/admin/benefits/includes/download-visual-studio.md b/subscriptions/faq/admin/benefits/includes/download-visual-studio.md index 721cf5230e2..354b4fe408c 100644 --- a/subscriptions/faq/admin/benefits/includes/download-visual-studio.md +++ b/subscriptions/faq/admin/benefits/includes/download-visual-studio.md @@ -1,12 +1,13 @@ --- title: How do my developers download Visual Studio? description: Learn how developers can download Visual Studio using Visual Studio subscriptions +comment: As of August 2023 this include is used to render marketing FAQ content for VS Subscriptions in the following portals - VSCom, Manage, and My portals. It was not used for learn.microsoft.com content at that time. SMEs are Evan Windom and Larissa Crawford of Red Door Collaborative and Sharvari Dighe. ms.faqid: group2_3 ms.topic: include ms.assetid: ee7e5ba2-a4b5-4db0-bd05-583dca51c75e author: evanwindom ms.author: amast -ms.date: 11/10/2020 +ms.date: 08/08/2023 --- ## How do my developers download Visual Studio?