Ctrl+Q, search for feature “exception settings” -> enable setting below
Category: Visual Studio
File Utils – Visual Studio 2022 show file encoding extension
Show file encoding and absolute path at the bottom of each editor, click to copy the path or change the file encoding.
Use .http files in Visual Studio 2022
The Visual Studio 2022
.http
file editor provides a convenient way to test ASP.NET Core projects, especially API apps. The editor provides a UI that:
- Creates and updates
.http
files.- Sends HTTP requests specified in
.http
files.- Displays the responses.
This article contains documentation for:
- The
.http
file syntax.- How to use the
.http
file editor.- How to create requests in
.http
files by using the Visual Studio 2022 Endpoints Explorer.The
.http
file format and editor was inspired by the Visual Studio Code REST Client extension. The Visual Studio 2022.http
editor recognizes.rest
as an alternative file extension for the same file format.
Source: Use .http files in Visual Studio 2022 | Microsoft Learn
New: Better search in Visual Studio – Visual Studio Blog
To enable the new search experience, go to Tools > Options > Environment > Preview Features > New Visual Studio Search Experience. After doing that, and restarting Visual Studio, you’ll now see the new search button appear in the title bar, as shown in the screenshot below.
Ctrl + T for code search and Ctrl + Q for feature search stay the same, so your muscle memory remains intact.
Source: New: Better search in Visual Studio – Visual Studio Blog
Visual Studio 2022 – locate file in solution explorer keyboard shortcut
Set a keyboard shortcut in Options -> Environment -> Keyboard
Search for the command: SolutionExplorer.SyncWithActiveDocument.
Se images below:
Fine Code Coverage – Visual Studio Marketplace
Visualize unit test code coverage easily for free in Visual Studio Community Edition (and other editions too)
Source: Fine Code Coverage – Visual Studio Marketplace
Usage:
- Install
- Open the Fine Code Coverage window
- Run all unit tests
- See stats in Fine Code Coverage window
- Exclude the test project itself from coverage calculation:
(Below excludes project that ends with .Test and all its types (*
Pattern: [assemblyname]type
Filter Expressions:
Wildcards
* => matches zero or more characters
Examples
[*]* => All types in all assemblies (nothing is instrumented)
[coverlet.*]Coverlet.Core.Coverage => The Coverage class in the Coverlet.Core namespace belonging to any assembly that matches coverlet.* (e.g coverlet.core)
[*]Coverlet.Core.Instrumentation.* => All types belonging to Coverlet.Core.Instrumentation namespace in any assembly
[coverlet.*.tests]* => All types in any assembly starting with coverlet. and ending with .tests
Both 'Exclude' and 'Include' options can be used together but 'Exclude' takes precedence.
Solution Colors – Visual Studio Marketplace
Allows you to associate a color with a solution and display it in various locations within Visual Studio. Inspired by the Peacock extension for VS Code.
Log info with tracepoints – Visual Studio (Windows) | Microsoft Docs
Tracepoints allow you to log information to the Output window under configurable conditions without modifying or stopping your code. This feature is supported for both managed languages (C#, Visual Basic, F#) and native code as well as languages such as JavaScript and Python.
Source: Log info with tracepoints – Visual Studio (Windows) | Microsoft Docs
EditorConfig settings – Visual Studio
You can add an EditorConfig file to your project or codebase to enforce consistent coding styles for everyone that works in the codebase. EditorConfig settings take precedence over global Visual Studio text editor settings. This means that you can tailor each codebase to use text editor settings that are specific to that project. You can still set your own personal editor preferences in the Visual Studio Options dialog box. Those settings apply whenever you’re working in a codebase without an .editorconfig file, or when the .editorconfig file doesn’t override a particular setting. An example of such a preference is indent style—tabs or spaces.
Source: EditorConfig settings – Visual Studio (Windows) | Microsoft Docs
Fine Code Coverage – Visual Studio Marketplace
Visualize unit test code coverage easily for free in Visual Studio Community Edition (and other editions too)