views:

469

answers:

7

Hello,

Let's get the duplication allegation out of the way.

I saw couple of variations of this question, notably, link. However, it doesn't address issue specific to C# developers. I want to collect a list most used/powerful/cool tricks--tips in VS from people who are using C# under visual studio 2005 (it's ok to mention for 2008 as well). Below are the links that I have used as a guide:

msdn <-- our guys from Microsoft have a tip or two to share

Kirill's Visual Studio Tips <-- This blog also has couple of good links

Debugging tips are also encouraged

Thank for sharing your tips and increasing my productivity :)

Some of my arsenal: - Ctrl-Minus, Ctrl-Plus, navigates back and forward where you've been recently

  • CTRL+SHIFT+V, which will cycle through your clipboard history

  • Hit F12 to go to definition of variable.

  • Ctrl-K, Ctrl-C to comment a block of text with // at the start

  • Ctrl-K, Ctrl-U to uncomment a block of text with // at the start

  • CTRL-/ to get to the find box.

  • Control+I for incremental search, F3 to iterate

  • Select an expression/variable in debug mode and type Ctrl-D,Ctrl-Q to open the quick watch window.

+4  A: 

Here is a site I just found last week http://scottcate.com/tricks/

The #1 tip I have is go buy Resharper!

abombss
I came to C# from Java, and Resharper adds almost everything I miss from IDEa
Matt Briggs
what does it add? I don't want to pay for extra tricks unless they are REALLY worthwhile and mandatory to have
This video (http://www.jetbrains.com/resharper/documentation/presentation/codingSession/CodingSession.wmv) is a pretty good illustration of the sorts of things you can do with Resharper if you know how to use it. And it doesn't even address Resharper's invaluable code-quality features.
Robert Rossney
+1 for resharper
Jason Slocomb
it seems to gain lots of support...greatzzz
It adds refactoring support, navigation, code analysis, and auto-completion, plus really nice custom templates. I recently had to dev something without R# and I can't believe how long it took me! Simple things like extracting interfaces, changing signatures, and renaming are so nice with R#!
abombss
A: 

The tab key for "snippets"

e.g. type 'try' and then hit the tab key twice.

Results in:

try 
{         

}
catch (Exception)
{

 throw;
}

which you can then expand.

nzpcmad
yep... I love this one, works for for lopps, if statements, etc...
+1  A: 

One of my favorite Snippets is the one for enums.

Say you have this code:

private void DoSomethingForToday(DayOfWeek today)
{
   //in here you want to do something different depending on which day it is, so you need a switch/case
   //you type switch, hit tab twice, you'll get this:

            switch (switch_on) //switch_on will be highlighted, replace it with "today" and hit enter. It will automatically fill in all the possible enum values with case statements.
            {
                default:
            }    
}
BFree
A: 

Ctrl-W, Ctrl-A -> to focus on the immediate window (the window itself is underused IMO).
of (filename) in the immediate window to open a file. You get nice path/name completion amongst all files in the solution.
Ctrl-W, Ctrl-S -> to foucs on the solution explorer.
Select an expression/variable in debug mode and type Ctrl-D,Ctrl-Q to open the quick watch window.

Mohit Chakraborty
A: 

See this:
http://stackoverflow.com/questions/9033/hidden-features-of-c

Don't let the url fool you: the 'friendly' url strips off the # symbol. This is the #3 highest voted question on StackOverflow, BTW, so it's not like it was exactly hidden.

Joel Coehoorn
Thanks, I saw this one -- it is too general for my needs.
A: 

CTRL +ALT + P to attach a process,

Oscar Cabrero
A: 

Have you seen this blog... and the book "Microsoft Visual Studio Tips" that came from it?

Richard
Nice.... I think I saw this website, in passing