Blog - Title

Visual Studio 2012 & 2013 Current Builds

  • The Ultimate Visual Studio Tips and Tricks Blog

    Keyboard Shortcuts for the Book

    • 12 Comments

     

    Folks,

     

    We just had a meeting the other day and are getting closer to the final draft for the book.  The piece I am most concerned about is how best to convey keyboard shortcut information so it is easy for you to use.  Here is the table structure we were originally thinking:

    image

     

    Notice the actions are on the left and keyboard settings are along the top.  During the discussion I thought it would be more logical to put the keyboard settings along the left and the actions across the top.  My thinking is that when you use the table you will start with your setting and then want to move right along actions you can take.  What do YOU think?  Do you like it the way it is or with the settings and actions switched?

  • The Ultimate Visual Studio Tips and Tricks Blog

    Collapsing Your Code with Outlining

    • 12 Comments

    Keyboard:  CTRL + M, CTRL + M
    Menu:  Edit -> Outlining -> Toggle Outlining Expansion
    Command:  Edit.ToggleOutliningExpansion
    Versions:  2008,2010
    Published:  3/15/2010
    Code:  vstipEdit0029

     

    By default, Outlining is enabled in Visual Studio.  It's the line you see with the boxes to indicate the status of the area (collapsed or expanded):

    image

     

    You can collapse areas of code to get them out of your way so you can focus on other areas.  There are four ways to do it:

    1. Click on the minus sign to collapse an area of code:

      image

      NOTE:  In VS2010 it now highlights the area that will be collapsed as seen here.  A very cool feature.  If you don't like the highlighting color you can go to Tools -> Options -> Environment -> Fonts and Colors -> Collapsible Region to change it.

    2. VS2010 ONLY:  Click ANYWHERE on the vertical line in the highlighted region.  In other words, you can now collapse a region from anywhere in that region:
      image 
    3. Click anywhere in the area to be collapsed and hit CTRL + M, CTRL + M
    4. Click anywhere in the area to be collapsed and go to Edit -> Outlining -> Toggle Outlining Expansion on the Menu Bar

     

    Once collapsed, the code area will look like this:

    image

  • The Ultimate Visual Studio Tips and Tricks Blog

    Track Changes in the Editor

    • 12 Comments

    Menu:  Tools -> Options -> Text Editor -> General
    Versions:  2008,2010
    Published:  4/14/2010
    Code:  vstipEdit0048

     

    Download the seriously cool Tip of the Day Extension to get the daily tips delivered to your Start Page!

     

    image

    To use this feature you need to have "Track Changes" and "Selection Margin" checked. 

     

    Okay, so ever wonder how those colors to the left of your code actually work?

    image

     

    Let's begin with a clean slate.  Notice there are no colors:

    image

     

    Now let me add a couple of lines of code:

    image

     

    So, all new code will turn yellow to show you what part of the document is "dirty" (unsaved).  If we save the code then we get this:

    image

     

    The "clean" (saved) indicator will remain as long as you have the file open.  When you close and reopen the file, this is what you get:

    image

     

    New in VS2010:  There is now an orange indicator that is used to show a change that is different from the saved version.  This was added for the scenario where a user does an undo after a save operation:

    image

     

     

    Here is a grid to help keep the scenarios straight:

    Marker Different from file saved on disk? Different from file that was opened?
    Nothing No No
    Yellow Yes Yes
    Green No Yes
    Orange Yes No

     

    Very cool stuff!

  • The Ultimate Visual Studio Tips and Tricks Blog

    View White Space

    • 11 Comments

    Keyboard:  CTRL + R, CTRL + W
    Menu:  Edit -> Advanced -> View White Space
    Command:  Edit.ViewWhiteSpace
    Versions:  2008,2010
    Published:  4/9/2010
    Code:  vstipEdit0043

    I've hijacked today's tip to remind everyone that next Monday I will start giving away $100 ThinkGeek gift certificates (one every day for about 30 days).  For details of my evil plan, go here.  Also, make sure to sign up for a Visual Studio Launch event in your area.  Happy coding!

    Download the seriously cool Tip of the Day Extension to get the daily tips delivered to your Start Page!

     

    Ever want to see the white space you are working with?  Maybe you want to know if your spaces are tabs or you have extra spaces on lines.  It's easy to view white space.  Just go to Edit -> Advanced -> View White Space (CTRL + R, CTRL + W) to go from this:

    image

     

    To this:

    image

  • The Ultimate Visual Studio Tips and Tricks Blog

    Create Code Shortcuts in the Task List

    • 11 Comments

    Keyboard:  CTRL + K, CTRL + H [toggles the shortcut on or off]
    Menu:  Edit -> Bookmarks -> Add Task List Shortcut
    Command:  Edit.ToggleTaskListShortcut
    Versions:  2008,2010
    Published:  6/8/2010
    Code:  vstipTool0030

     

    You can create shortcuts to lines of code that you want to revisit later.  It's easy!  Just go to any line of code then press CTRL + K, CTRL + H (toggles the shortcut on or off).  This will create the shortcut glyph in the Margin like this:

    image

     

    To see all your shortcuts, go to the Task List (CTRL + \, T) and choose "Shortcuts" from the drop-down list:

    image

     

    Now you should see all your shortcuts:

    image

     

    You can now treat them like any other task and set priority levels as well as mark them complete:

    image

     

    NOTE:  You can RIGHT CLICK any task and choose "Delete" to remove it from the list.

  • The Ultimate Visual Studio Tips and Tricks Blog

    Prototype Tip for the New Book

    • 11 Comments

    Folks,

     

    Wanted to get your input on this one.  I'm working on the new Tips and Tricks book and had a concept for how I want to show the information.  The format is basically the same it is now except heavier use of graphics so instead of SHIFT + ALT + [UP or DOWN ARROW] I use pictures instead.  I'm also going to include keyboard mappings if they are different than the default and add mouse commands.  There will also be some graphic to represent the version(s) supported and, finally, a list of related tips.  This is a VERY rough draft but wanted to get folks engaged early on to get your thoughts.

     

    Here is the prototype tip that I was thinking of:

    ======================================================

    Zero-length box selection

    vstipEdit0009

    clip_image002 + clip_image004+clip_image006clip_image008

    clip_image004[1] +clip_image011

    clip_image013

     

    Related Tips: vstipEdit0006, vstipEdit0007, vstipEdit0008

     

    Let's assume that you have a situation with some variables like the ones below and you want to make them all public:
    clip_image015

    The answer is a zero-length box selection.  Hold down your ALT key and Left Mouse Button, then drag straight down.  Note the line that is created:
    clip_image017

    Release the ALT key and the Left Mouse Button.  Now, just start typing:
    clip_image019

    Bask in the wonder and glory that is the zero-length box selection! :)

  • The Ultimate Visual Studio Tips and Tricks Blog

    The Immediate Window: Working with Members

    • 11 Comments

    Keyboard:  CTRL + ALT + I
    Menu:  Debug -> Windows -> Immediate
    Command:  Debug.Immediate
    Versions:  2008,2010
    Published:  9/28/2010
    Code:  vstipTool0095

     

    When using with the Immediate Window, you can work with class and object members directly:

     

    Debug

    You can use any method or property as long as it is in context.  So, for example, when you are in debug mode, you can call any method that is in scope:

    image

     

     

    Design

    A less-known feature is you can work with properties and methods while in design mode.  If you have static methods on a class, for example, you can just execute them right away:

    image

     

     

    For object members, obviously, you need to create an instance of the object before working with the members:

    image

     

    WARNING:  When working with members at design-time a build will occur.  This could have unintended consequences so make sure you have experimented with this feature a bit before you use it.

  • The Ultimate Visual Studio Tips and Tricks Blog

    Agile Processes in a Waterfall World...

    • 11 Comments

    Really nice article Agile meets Waterfall.  It's technology is Java but easily translated to our world:

     

    http://www.javaworld.com/javaworld/jw-03-2008/jw-03-agile-practice.html

  • The Ultimate Visual Studio Tips and Tricks Blog

    Web Application Projects vs. Web Site Projects in Visual Studio 2008

    • 11 Comments

    The last one!  This series is DONE!  Keep an eye out for more my next series in a month or so.

     

    Wecast is here and files are attached.

  • The Ultimate Visual Studio Tips and Tricks Blog

    Visual Studio 2013 Preview: Code Map Debugger Integration

    • 11 Comments

    5-16-2012 12-48-10 PM

     

    Prologue

    The original Code Map was introduced in the product with Visual Studio 2012 Update 1. You need to read my original post before moving on:

    http://blogs.msdn.com/b/zainnab/archive/2013/02/07/visual-studio-2012-update-1-understanding-code-map.aspx

     

    My assessment at the time was that it was a good feature but had poor performance and didn’t really add much value relative to Dependency Graphs. With debugger integration however Code Maps have definitely come into their own and the performance is very good.

     

    Note: Code Map Debugger Integration is a feature in the Ultimate edition of Visual Studio.

     

     

     

    Code Map Debugger Integration

    Assuming you have a handle on Code Maps now let’s see how the debugger integration works. First, I’ll take the TailSpin Toys sample code and set a breakpoint within the code base (ShoppingCart.cs, line 61):

    5-16-2012 12-04-13 PM

     

     

    I’ll press F5 and add an item to my cart to trigger the debugger:

    5-16-2012 12-07-12 PM

     

     

    Ordinarily, we would step though the code and hope we remember how we got to a particular place. Those days are gone! Now we can turn on the Code Map feature while debugging:

    5-16-2012 12-12-27 PM

     

     

    You can also find this on the Menu Bar at Debug | Show Call Stack on Code Map:

    5-16-2012 12-13-37 PM

     

     

    You will see a Code Map in sync with the debugger at this point. You can create Code Maps in C#, VB, C++, JavaScript currently. Once activated all future debugging sessions will include a Code Map until you turn this feature off:

    5-16-2012 12-17-38 PM

     

     

    If we take a closer look at the current map, we can see that it shows how we arrived at the current call (the squares above the last AddItem call) and our current location (yellow arrow). Although the current location indicator is partially covering it, you can also see the breakpoint indicator:

    5-16-2012 12-27-35 PM

     

     

    Stepping through the code we see the map keeps updating so we don’t have to keep the path in our heads:

    5-16-2012 12-29-19 PM

     

     

    The Code Map will continue to update for our debugging session showing where we have been and where we currently are in the call stack:

    5-16-2012 12-35-58 PM

     

     

    The graphs can get quite large:

    5-16-2012 12-40-46 PM

     

     

    For this reason it’s important to use the map tools at your disposal. The context menu items when you Right Click any node are a great example of common tools:

    5-16-2012 12-45-23 PM

     

     

    You can Double Click any node to view the code from that location in the stack. A green arrow will indicate your current position:

    5-16-2012 12-54-27 PM

     

     

    If you happen to choose a node that isn’t part of the current active call stack then you will get a slightly different indicator:

    5-16-2012 12-57-41 PM

     

     

    When you stop debugging the Code Map will be preserved so you can save it if desired and keep a map of the code base you just went through. I think this is an exceptional addition to the debugging experience!

Page 5 of 135 (1,345 items) «34567»