Showing posts with label Visual Studio. Show all posts
Showing posts with label Visual Studio. Show all posts

Sunday, 30 August 2020

Find the current opened file in the solution explorer - Visual Studio tips

Hi Everyone,

Today I was working on some project and I have added a new file in the project, we have a habit of refreshing Solution Explorer when we do this. 

Instead of clicking on Refresh button on Solution Explorer, it happened to click the button which is next to it. Trust me, I have never used and don't even know anything about that till I clicked it.

I feel, it is a good feature that every developer must know. When we click on this, it automatically selects the file which is currently opened in Canvas. Check the below video to understand more.


This has raised a thought in my mind, why don't Visual studio automatically select the item which is opened instead of giving a button to click. After a quick search on this came to know that there is setting for this.

Visual Studio  --> Tools  --> Options  --> Projects and Solutions  --> General
Check "Track Active Item in Solution Explorer" which will automatically selects the current opened file in Solution Explorer.

Hope this helps.

--
Happy Coding,
Gopinath.

Wednesday, 17 June 2020

Cool feature in Visual Studio - Generate Class from JSON or XML

Hi Everyone,

Today I was asked a question by one of my friends on if I know any easy way which can generate C# Class if we give JSON as an input. And I don't know anyway but certainly there should be an easy way to do the same.

To my surprise, it turned to be a very easy one. Visual Studio has cool feature, copy JSON or XML to the clipboard  --> Open any class file  --> Edit --> Paste Special.

Hope this helps.

--
Happy Coding
Gopinath

Sunday, 7 April 2019

Add or Remove Components and workloads in Visual Studio

Hi,

We all know that at the time of installing Visual Studio, we get a window to select the components that we need for the development so that it automatically installs everything on the machine as per the selection.

Let's say you have not selected a component at the time of installation and later you have got a requirement to start on the new things. Here is the way to go back to the installer and select the things.

1) Search for Visual Studio Installer on your machine. 

If you cannot find that on your machine, alternatively you can check at the below location or give the below path in Run window.


C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe


2) Click or tap to start the installer, and then choose Modify.

If you have an update pending, the Modify button is in a different place. This way, you can modify Visual Studio without updating it, should you choose to do so. Click More, and then choose Modify.

3) From the Workloads screen, select or deselect the workloads that you want to install or uninstall.

4) Choose Modify again.
5) After the new workloads and components are installed, choose Launch

Modify individual components
If you don't want to install workloads to customize your Visual Studio installation, choose the Individual Components tab from the Visual Studio Installer, select what you want, and then follow the prompts.

Hope this helps.

--
Happy Coding
Gopinath

Thursday, 4 April 2019

Work Items opening in browser instead of Visual Studio

Hi,

Recently, I have installed VS 2017 and did set VSTS for one of my projects and started checking my work items. I have observed that we enter some ID on Go to Item popup, it is opening the item in the browser instead of Visual Studio. 

There is a setting that needs to setup in Visual Studio -> Tools -> Options -> Work Items -> General and select Visual Studio as shown in the screen shot below. 



Hope this helps.

--
Happy Coding
Gopinath

Tuesday, 8 March 2016

Run To Cursor in Visual Studio

Hi,

I was sitting in front of lap where Visual Studio is opened and right clicked and selected Run To Cursor. Immediately my application did build and started running and stopped on the line where I select Run To Cursor. Thought this is really cool feature and wanted to share this.

Run to cursor is a great and hidden features. Instead of doing step by step debugging, we can directly start debugging where we need to stop. It is just like a breakpoint in fact it is better than breakpoint. When we select the run to cursor option, Visual Studio start the debugger automatically and execution stops to the selected line.


Short cut for it is CTRL + F10

Hope this helps.

--
Happy Coding

Gopinath

Monday, 7 December 2015

Build, Rebuild and Clean in Visual Studio

Hi,

Today I was talking to a fresher and explaining some of the shortcuts in Visual studio and how we build solutions etc.. and so thought of the writing about Build, Rebuild and Clean Solution in Visual Studio.

These three things very often used in Visual Studio.

Build Solution
Incremental build and compiles only the files that are modified. When build solution if there are no changes made to the files Visual Studio won't do anything. Visual Studio builds the assembly only if there are changes to the files.


Clean Solution
Deletes all compiled files, output directories. If your solution has multiple projects, VS cleans project by project.


Rebuild SolutionDeletes all compiled files and compiles all the things irrespective changes happened. In simple words, Clean + Build = Rebuild.

Hope this helps.

--
Happy Coding
Gopinath