C# IDE Tips & Tricks: Part I


C# Developers has been spending most their day activities with Visual studio IDE. They may have to understand the following activities to do their job.

  • Understanding Code: Developer must be able analyze the relationship between classes and what API it is using for implementing the logic.
  • Navigating Code: Developer may or may not know where he want to navigate to the code and keep track of visited files in the code.
  • Writing & Modifying Code: Developers may require to modify the existing code like refactoring which involves make the code readable and fix bugs etc
  • Debugging & Testing: Understanding the using of debugger tools and writing unit test cases.

Visual studio provides the tools for all the activities mentioned above to make the developer efficient and productive. This post speaks about using the tools available in
VS 2008 sp1. It also discusses about the tool coderush express which Microsoft partnering and allows the developers to download and use freely.

Download Coderush for C#

1. One of the short cut for goto definition is F12

For example you have an identifier and you want to know where it is declared just press F12. If the identifier is not your project then it shows the metadata of the identifier. eg we are viewing string class


 
2. When you bring the code definition windows by Ctrl + W, D  you will see the following picture


 
When you move the code on top window it shows the declarations in the code definition window.

You can use Ctrl + Shift, 8 to come back from the declaration. F12 is for go to the definition of window and Ctrl + Shift, 8 is to come back to the origin.

You can also view the Navigation stack by Ctrl -.

3. To find all the references in your project for a particular method or type you can use Shift + 12 which shows the following window in IDE


 
To navigate to the references list window you  can use F8.
 
4. Some times when you are working on a really big project and you want to know which file you are actively using and you want know where it is in solution explorer. You can find the file in the solution explorer by going to Tools-Options dialogue box and selecting the General option under the projects solutions.


 
You can track the active item in solution explorer by checking the above option.
 
5. Code rush express short cut when you want to go to the file use 

Ctrl + Alt + F you will get the following window


 
It also filters the files based on the input and camel case.

If you want to go to any type or method in your project then you can use coderush shortcut   Ctrl + Shift , Q it show the following window


 
If you want to see the identifier where it is used in the project you can use

Ctrl + Alt , U.  you can use tab key to navigate between the identifiers.


 
6. To navigate to the open files in the IDE you can use Ctrl  + Tab


 
You can also use Ctrl + Alt + Down to bring the following window


 
7. Viewing the class designer


 
You can view the class designer of the class and it dynamically updated whenever you change the class in code definition window.

Summarizing what we have learned so far

In the next post I will explain about more tips.


Similar Articles