Translate

All about Visual studio

 You will learn followings

  • Keep Visual Studio debugger ON when the browser is closed
  • How to Quickly Move Between Methods in Visual Studio?
  • Multiple Rows for Tabs in Visual Studio 2022
  • Visual Studio 2022: Quickly Reopen the Closed Files
  • How to identify the project dependencies in Visual Studio?
  • How to Choose C# Language latest version (minor release) in Visual Studio


Keep Visual Studio debugger ON when the browser is closed



We can keep the Visual Studio debugger enabled, even when the project's output browser is closed. When we work with web projects, as soon as we close the web browser window, Visual Studio stops the debugger. During this time, you may want to review old debugging data or other traces. However, when you close the browser, Visual Studio stops the debugging session. Usually this can happen as expected, however, in some cases we want the debugging session to be active or continue debugging. Well, Visual Studio allows us to control that. Let's see how we can achieve this.


Keep Visual Studio debugger ON / OFF

  • Open the Visual Studio Option Dialog Window.
  •  Search for Web Projects options, and you will find “Stop debugger when browser is closed



If the "Stop debugger when closing browser" box is checked, Visual Studio will terminate the debugger as soon as you close the browser. When unchecked, Visual Studio will continue running the debugging session. As long as the debugging session is enabled, you can open your web project in the browser and restart debugging your application.



How to Quickly Move Between Methods in Visual Studio?


Similar to browsing Visual Studio and IDE files, you can quickly switch between methods in Visual Studio. Navigate faster to code, files, and Windows IDE tools for high productivity during development. Moving quickly between methods in Visual Studio is also part of it. Visual Studio IDE has several sets of options for moving files, tools, and even code. Additionally, to improve code navigation, you can also try code navigation by bookmarking your code in Visual Studio.

How to Quickly Move Between Methods in Visual Studio

Visual Studio provides options for “Next Method” and “Preview Method” navigation.  This will help you quickly move back and forth through the method.  You can find these two options from Edit > Next Method | Edit > Previous Method



Assigning Keyboard Shortcut

For much faster navigation, you can easily add keyboard shortcuts to menu options.

Open the Customize window (right click on the toolbar > Select Customize) and select the “Edit” option from the “Menu Bar”.

Select the corresponding menu option, such as selecting "Next method", then click "Keyboard".



You can also open the Options dialog window and navigate to the Keyboard section. From here you can also find and assign hotkeys.


Multiple Rows for Tabs in Visual Studio 2022


In this post, we will discuss on "Multiple Rows for Tabs in Visual Studio 2022". Now you can easily access all open tabs in Visual Studio. If you have multiple document tabs open, you don't have to go back and forth to navigate to them and select them from drop-down lists. “Allow multiple lines for document tabs” has been a long-pending feature request, and finally, it's here. Visual Studio 2022 now allows multiple rows for tabs by enabling “Show tabs in multiple rows”.

Considering Multiple rows are not enabled, then we are used to pick up the files from the list. This will wrap up to multiple rows only for Pinned tabs.

Enable Multiple Rows for Tabs in Visual Studio 2022

Navigate to Tools Options Tools and Windows > Then Select “Show Tabs in multiple Rows.”



If we enable the “Show tabs in multiple rows” option, all the tabs will be horizontally wrapped and spilled into multiple rows for easier access, as shown in the following image.



You can now enable additional customization such as “Bold text on Selected tabs” to quickly identify active documents.



Overall, this is a great addition to Visual Studio and will improve developer productivity. As noted above. “Allow multiple lines for document tabs” was a long-awaited request from the Visual Studio community and it is finally supported.



Visual Studio 2022: Quickly Reopen the Closed Files


Have you unintentionally closed a source code file and then realized you require it back? The alternative was to return to the solution explorer, locate the file, and reopen it. Not a challenging task, but occasionally it becomes! You have a more extensive solution and especially when you are in hurry to accomplish something. Visual Studio 2022 enables rapidly reopening the most recent document you have closed. You can open most recent closed file and follow the same process to open all previous files which you have closed. One by one you can open older files too.

How to do this Visual studio 2022

Right-click on Tab, now select “Restore Closed Tab “. Additionally, if you want, you can use the keyboard shortcut Ctrl+KCtrl+Z to reopen the closed file.



"Restore Closed Tab" will display the most recently closed files without distracting you from any other aspect of the Visual Studio IDE.

If you wish to retrieve multiple closed documents, you can use the same method, and Visual Studio will display each closed document in the order they were closed.

How To track visual studio active files automatically?

Additionally, when working in a vast Visual Studio Solution with numerous projects, it becomes challenging to keep tabs on the files that are currently active or being worked on. Having a way to track this information would greatly assist us in understanding our progress within the solution or identifying the specific layer we are currently focusing on. If we cannot automate this process, we will have to manually scroll through the entire solution explorer in order to locate the files or conduct a search within the solution explorer for a particular file.

Navigate To Tools -> Options -> Projects and Solutions -> General ->” Track Active Item in Solution Explorer” and check this option to turn 'ON' this feature of tracking active files automatically.



We hope above tips will help you in your daily development practices.



How to identify the project dependencies in Visual Studio?


In this post we'll learn about "How to identify the project dependencies in Visual Studio?". In the previous post you have seen the difference between Build and Rebuild solution in Visual Studio and how things work under the hood. In the last section of the post, we also talked about the project dependencies and the build order of the projects, which is dependent on project dependencies.  In this post let's have a quick look how you can view the project dependency in Visual Studio.

To view the Project Dependencies, Right Click on the Solution and select “Project Dependencies…” as shown in the image below.



This will bring the “Project Dependency” dialog window where you can view the dependencies for the selected project.  Select the project from the “Projects” dropdown to see the related dependent projects.



As appearing in the above pictures all the dependent projects are “Checked”.

There is another alternative way to get these details, right click on the solution in Solution Explorer, choose Property from the context menu, and then select Project Dependencies.



You can also visualize the dependency of projects using Code Map and I personally prefer these options.  In this case, you don’t need to select individual projects from the dropdown to verify the dependency; as this provides a complete view of dependencies.  The generated code map can display all  the dependency references together.

Navigate to Architecture –> “Generate Code Map for Solution



This will generate the nice dependency diagram for the projects. As shown in the below images, you can see how the projects / libraries are dependent on each other in a single view.



You can further explore to each node to get more inside of the each and individual elements of projects.


How to Choose C# Language latest version (minor release) in Visual Studio


In this post we'll learn about "How to Choose C# Language latest version (minor release) in Visual Studio". Visual Studio allows you to choose the latest version of the C# language for your project. To select the latest version of the C# language, in Visual Studio, in Solution Explorer, right-click on the project and select Properties -> Build Tab. And then select the Advanced button. This will open the “Advanced build settings” window where you can select the “Language version” drop-down option. You can refer to one of my old tips: How to check default language version in Visual Studio?

C# language latest versions

In previous versions of Visual Studio, language version was used by default to select the default language version installed. Now there's a change. By default, it now refers to the major version that has been released - (latest major version of C#) starting with C# language version 7.1. When this option is selected, you will only be able to use C# 7.0 features, even if other versions of C# 7.1 or C# 7.2 are installed. Unless you make explicit changes to select the minor version, the major version will be used by default. Go to Properties -> Build -> Advanced, select “Latest C# Minor Version (Latest)” to select the latest minor version installed.




The C# latest major version is the default language version set and choosing the “C# latest minor version” it will always refer to latest C# version, in this case it will refer to C# 7.2.

Check out all new features of C# 7.0 

Here is the quick difference between two version of Visual Studio






No comments:

Post a Comment

Popular Posts