TechBubbles Microsoft Technology BLOG

C# IDE Tips & Tricks Part 1

C# Developers have 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 refractoring 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

Untitled 

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

codedfnwindow

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

references

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.

TrackActive

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

qfile

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 

Qfile3

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.

qfile2

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

active

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

down

7. Viewing the class designer

classdia

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

ctips

 

c3

In the next post I will explain about more tips.

Share this post :

About the author

Kalyan Bandarupalli

My name is kalyan, I am a software architect and builds the applications using Microsoft .NET technologies. Here I am trying to share what I feel and what I think with whoever comes along wandering to Internet home of mine.I hope that this page and its contents will speak for me and that is the reason I am not going to say anything specially about my self here.

Add Comment

TechBubbles Microsoft Technology BLOG

Follow me

Archives

Tag Cloud