Blog - Title

Visual Studio 2013 Current Status

  • The Ultimate Visual Studio Tips and Tricks Blog

    Reset All Your Development Settings

    • 2 Comments

    Menu:  Tools -> Import and Export Settings
    Command:  Tools.ImportandExport Settings
    Versions:  2008,2010
    Published:  7/16/2010
    Code:  vstipEnv0023

     

    In the final post dealing with the Import and Export Settings Wizard, we deal with the nuclear option-the "Reset all settings" option:

    image

     

    WARNING:  Use this at your own risk.  It WILL reset your settings and do things like reset your Toolbox thus getting rid of any custom tabs, code pieces, etc.. you have put in there.

     

    Clicking Next will give you the option to save your current settings.  YOU SHOULD ABSOLUTELY DO THIS:

    image

     

    The next screen let's you choose from the list of default settings:

    image

     

    Choose your default settings of choice and click "Finish".  It will run for a few minutes and reset all your settings.  This is definitely something you would do as a last resort and, remember, you can always bring your old settings back by importing the previous settings.

  • The Ultimate Visual Studio Tips and Tricks Blog

    Proposed Book Title

    • 32 Comments

    The new book is entering its final stages before we start work in earnest.  After much discussion internally we have finally come up with a potential title for the new book and I wanted to get your thoughts.  Let me preface this with the following:  We wanted to depart from the “tips and tricks” moniker for the book as we feel it doesn’t adequately portray what the book does (or should do at least).  With that said, the current thought on a title is (drum roll, please):

     

    Microsoft Visual Studio Productivity Handbook

     

    I really want your feedback on this one.  Does it suck?  Do you like it?  Tell me your thoughts…

     

    Z

  • The Ultimate Visual Studio Tips and Tricks Blog

    Visual Studio 2012 New Features: Preview Tab

    • 16 Comments

     

    Preview Tab Overview

    We all explore code and need to move quickly between files when examining code to get familiar with it or debugging or [insert file browsing scenario here]. In prior versions of Visual Studio you had to open a file to look at the contents which often resulted in many open files (tabs) when you were done. The Preview Tab eliminates the need to open files when browsing code. Most likely you’ll first encounter the Preview Tab when you are looking at files with Solution Explorer. When you click on a supported file type, you will see the contents of that file in the new preview tab (to the far right in the tab well):

    image

     

    If you click anywhere inside the file the tab will go from grey to purple to distinguish it from regular (blue) tabs:

    image

     

    Again, the point of the preview tab is to let you view the contents of a file without actually opening up a new tab in the tab well. As you look at different files the preview tab only shows the contents of the file you are currently on. This keeps the environment from getting cluttered with open tabs and allows you to focus on only those files that are interesting to you. Solution Explorer isn’t the only place you can use the preview feature. It turns up in several situations where you might need to look at file content. For example, when using Find in Files (CTRL + SHIFT + F) to locate information you will see the preview tab:

    image

     

     

    Promoting Previews

    At some point you may decide to promote the preview to an opened tab in the Tab Well so you can do additional work on the file or just keep it around for other purposes. There are a few ways you can make this happen.

     

    Click the Keep Open button

    Probably the least useful and and least likely technique you will use is to click on the tiny Keep Open button on the Preview Tab.  It’s not only useless it’s actually kind of annoying for some reason I can’t identify:

    image

     

    Double Click the File

    The most likely approach is you will just double click the file in Solution Explorer or whatever results dialog you happen to be in.

     

    Press CTRL + ALT + HOME

    With the cursor inside the file (the tab is purple), just press CTRL + ALT + HOME to open a tab for the file you are currently viewing.

     

    Change the File

    While previewing a file, if you make any change to the file it will automatically be promoted to an open tab so that you can make additional changes and do any other actions you need to perform.

     

    Click the Preview Selected Items button

    Another button is useless and a waste of space on the Solution Explorer toolbar is the Preview Selected Items button.  You can click it to preview the current file and its only use that I can find is if you turn off single clicking a file to preview it (see below).  Also the tooltip would lead you to believe that you can select multiple files and preview them.  Nope.  Doesn’t work.  Don’t waste your time with this button.

    image

     

     

    Turning Preview Off

    To see the options you have for using the preview feature, just type preview in Quick Launch (CTRL + Q) and click Environment -> Tabs and Windows:

    image

     

    This will take you to Tools | Options | Environment | Tabs and Windows:

    image

     

     

    To turn off the preview feature (NOT suggested unless you are having performance issues with it) uncheck the Allow New Files to be Opened in the Preview Tab option. Also notice you can decide if a single click open the files in for preview in Solution Explorer and Find dialogs. For Solution Explorer you can use ALT to prevent a file from being previewed when you click on it. While I see the value in using ALT to prevent preview from happening. I haven’t yet found any reason for turning off the single-click option as it, in effect, forces you to use the Preview Selected Items button which is a lot of extra work and kind of defeats the purpose of the feature.

     

     

    Finally

    The Preview Tab is one of my top two favorite features in Visual Studio 2012 (the other one being project round-tripping).  You definitely want to leverage this feature to make your life easier.

  • 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!

  • The Ultimate Visual Studio Tips and Tricks Blog

    Visual Studio 2010 Tips and Tricks Begins!

    • 2 Comments

     

    I'm happy to announce that the New Year marks the beginning of my endeavor to carry on Sara Ford's great work with Visual Studio Tips and Tricks for the Visual Studio product  (http://blogs.msdn.com/saraford/archive/tags/Visual+Studio+2008+Tip+of+the+Day/default.aspx).  After many discussions between us on how best to move the effort forward we decided that continuing the love with 2010 was a good idea.  With Sara's help I have managed to get a good idea of her approach and added elements of my own style to the mix. 

     

    Additionally, in conjunction with Scott Cate (http://scottcate.com), I am pleased to say almost all tips will include a video showing the tip in action.  Many thanks to Scott for stepping up and doing the past and future videos related to this series.  

     

    I haven't decided to crank out the book proposal yet for a new edition and probably won't for a while yet but am thinking the updated version will include versions 2005, 2008, and 2010 as well as (per Sara's suggestion) some new sections on extending Visual Studio with macros and the new extensibility model.

     

    There was some debate over whether to wait until VS2010 launches or begin with the New Year.  As you can see, I decided to begin on January 1.  This is important for a couple of reasons:

     

    1.  The tips published until RTM will be based on Beta 2 and RC builds.

    2.  It is possible (though unlikely) some of the tips may not be valid in the RTM build when it ships.   I will be retesting all tips when VS2010 ships to make sure they work as advertised :)

     

    The plan is to have a tip a day posted on this blog with a few extra items thrown in for good measure.  What you will see is a healthy mix of new tips in Visual Studio 2010 and some of the old favorites as well (tested to make sure they still work).  To be absolutely clear:  These are Visual Studio 2010 Tips and Tricks so what you will see are the details on how to leverage old and new content with our latest product.  To get things started, and through the inaugural weekend, let's take a look at the #1 tip from Sara's Tips and Tricks:

     

     

    How to behold the power of Incremental Search

     

    Tip Code:  vstipFind0001

    Keyboard Shortcut:  CTRL + I

    Video:  http://scottcate.com/tricks/001/

    Menu Command:  Edit -> Advanced -> Incremental Search

     

     

    Incremental search is a powerful search to use when you want to keep both your focus and your cursor in the editor when searching in the current document. It is powerful because it allows you to keep typing, meaning the search is driven by keystrokes. And you don't need to interact with any UI.

     

    To conduct an incremental search, follow these steps:

    1. Press Ctrl+I.

    2. Start typing the text you are searching for.  You'll see the cursor jump to the first match, highlighting the current search string:

      image

    3. If you look in the lower-left corner of your screen you will see an indication that you are doing an Incremental Search:

      image

    4. Press Ctrl+I again to jump to the next occurrence of the search string:
      image

    Here are all the options you can leverage while in this mode:

    To

    Use

    Move to the next match in the file

    CTRL+I

    Reverse the direction of the search

    CTRL+SHIFT+I

    Remove a character from the search string

    BACKSPACE

    Stop the incremental search

    ESC

  • The Ultimate Visual Studio Tips and Tricks Blog

    Creating, Configuring, and Consuming a WCF Service in IIS 7

    • 10 Comments

    After much delay, here are the goods :)

     

    The goal here is to show how to create a basic WCF service that can be hosted in IIS7 and will kick over to other protocols using Windows Activation Service (WAS) as needed.  Your choice of language doesn't matter for this one and I will show code for C# and VB.  And awaaaaaaay we go...

     

     

    1. Start up Visual Studio by running it as Administrator

      image
    2. Begin creating a new Web Site

      image
    3. Feel free to pick your language of choice, for this demo I will call the services CoolServiceCS and CoolServiceVB respectively

      image
    4. Press F5 to build and run the application just to make sure all is well so far, you will get the obligatory error for debugging, just click OK:

      image
    5. You should ultimately see a web page that has something like this:

      image
    6. Close the service web page and let's see if IIS7 is aware of this service
    7. Go to the IIS Manager

      image

      image
    8. Expand the tree and, under "Default Web Site", you should see your service.

      image
    9. Okay!  So far everything seems to be going well.  Now let's take a quick peek at the service in Visual Studio to verify that it is, in fact, using HTTP to communicate.
    10. There are a couple of ways we can do this:  One way is to just open up Web.config and scroll to the <services> element:

      image
    11. Another way is to right-click on your Web.config and choose "Edit WCF Configuration..."
      SPECIAL NOTE:  There seems to be a "feature" that makes this not show up initially.  This is usually "fixed" by simply going to Tools...WCF Service Configuration Editor
      The funny thing is you don't appear to have to actually use this tool just open it and close it then you can right-click Web.config to get the editor option.  Weird.

      image
    12. If you expand the Service area and look at the Endpoints, you can see that wsHTTPBinding is used.  Once you have verified, close this dialog box.

      image
    13. The only thing I wish here is that the endpoints would be "automagically" named for us (we could always change the names) but, sadly, that is not the case.
    14. At this point we have created our service, run it, verified it is in IIS, and verified it uses wsHTTPBinding.  Now we need to create a client to consume the service.
    15. In Visual Studio, right-click on your Solution and choose Add New Project...

      image
    16. Let's use a Console Application for our client this time around.  Make sure to use your language of choice.

      image
    17. Call the application "CoolServiceClientVB" or "CoolServiceClientCS" as appropriate then click on OK.

      image
    18. Set the new project as the Startup Project.  

      image
    19. Now we need to right-click on the project and choose Add Service Reference...

      image
    20. The new service dialog is very cool and will find services in your solution if you just click on Discover --go for it! 

      image
    21. Leave all other settings as they are and click on OK.  You should see your reference in Solution Explorer.

      image
    22. Now let's crank a little code to actually use this service (finally!) heheh...
    23. Open up Module1.vb or Program.cs and put the following code in:

      VB:
    24. Sub Main()
             Dim myService As New ServiceReference1.ServiceClient()

             Console.WriteLine(myService.GetData(33).ToString())

             Console.ReadKey()
         End Sub

      CS:

      static void Main(string[] args)
              {
                  ServiceReference1.ServiceClient myService =
                      new CoolServiceClientCS.ServiceReference1.ServiceClient();

                  Console.WriteLine(myService.GetData(33).ToString());

                  Console.ReadKey();
              }

    25. This should look pretty straightforward.  We are calling one of the sample operations that are available with our WCF Service and then use ReadKey() to pause when we run the app.
    26. Press F5 to run this sucker and you should get this:

      image
    27. Press any key to continue.
    28. So we have a client and we have a service and we are all having a group hug.  Now what?  Well, now let's configure this puppy to use other protocols besides HTTP.  For this run, we will use TCP and Named Pipes.
    29. First, we have to configure Windows Process Activation Service (WAS) settings.  To learn more about WAS, go here:  http://msdn.microsoft.com/en-us/library/ms730158.aspx
    30. Assuming you're running Vista, we have to tell WAS that non-HTTP protocols can be used for activation.  If we were not using IIS to host this service we would also have had to tell it that HTTP activation is possible but fortunately IIS handles those details for us.  For more info on what we are doing here, you can check out this area http://msdn.microsoft.com/en-us/library/ms752218.aspx
    31. Go to Control Panel

      image
    32. Choose Programs

      image
    33. Now select Turn Windows Features On or Off

      image
    34. Go to the Microsoft .NET Framework 3.0 area and check the WCF Non-HTTP Activation.  NOTE:  Since this is my play machine, I also turned on WCF HTTP Activation as well but you don't have to unless you need it.

      image
    35. Click on OK; It may take a minute to install the needed files so be patient.  Go grab a drink or something, go on, you deserve it :)
    36. Next we have to configure the the web site to be bound to a TCP port for our activation to work.
    37. Open a command prompt with administrative privileges by right-clicking on the command prompt icon and choosing Run as Administrator

      image
    38. Copy and paste the following command into the command prompt area and press Enter

      %windir%\system32\inetsrv\appcmd.exe set site "Default Web Site" -+bindings.[protocol='net.tcp',bindingInformation='808:*']
    39. The result should look similar to the following:

      image
    40. Now the Default Web Site is bound to TCP but we still need to allow TCP for our applicationCopy and paste the following into the command prompt area and press Enter:

      VB
      %windir%\system32\inetsrv\appcmd.exe set app "Default Web Site/CoolServiceVB" /enabledProtocols:http,net.tcp

      CS
      %windir%\system32\inetsrv\appcmd.exe set app "Default Web Site/CoolServiceCS" /enabledProtocols:http,net.tcp
    41. You should see something like this:

      image 
    42. Okay, the hard part is done.  We now have the Web Site and the application within the site configured for TCP.  We just need to tell the service to use TCP and then have the client use TCP to talk to the service.  Here we go!
    43. To configure the service, go to Visual Studio and Solution Explorer.  Now let's go to our service and right-click on Web.config to edit the WCF Configuration.  You may have to do that stupid Tools...WCF Service Configuration Editor workaround to get the context menu item to show up.  You may wonder why I just don't have you edit the XML directly and the answer is simple:  I'm all about easy and think that this way is easier for folks.

      image
    44. We need to make sure the service knows it can use TCP by creating a new endpoint.  Currently the only usable endpoint for communicating is HTTP but we are going to change that by right-clicking on endpoints under the Service and adding a new service endpoint.

      image
    45. Enter myTcpGoodness for the Name, choose netTcpBinding for the Binding, and enter IService for the Contract as seen here:

      image
    46. We also need to identify the BaseAddress for getting to our service.  Go to the Host area in the current dialog.

      image
    47. Under Base Address, click on New... and type in the following for the address then press enter:

      VB
      net.tcp://localhost/CoolServiceVB

      CS
      net.tcp://localhost/CoolServiceCS
    48. You should see something like this in the BaseAddress area:

      image
    49. Close the configuration dialog and you should be prompted to save changes.  Click Yes.

      image
    50. Let's make sure there are no errors.  Build the service by right-clicking on it and choosing Build Web Site.
    51. WOW!  We are on step 50 now.  Does it feel like your brain is going to explode like in the movie "Scanners"? http://www.imdb.com/title/tt0081455/  Just stay with me, we are almost done.
    52. At this point we could start configuring the client but I really like to run the service one last time to make sure there are no issues.  So this step is optional but suggested just to make sure everything is good with the service:  (1) Right-click on the Service.svc file and set it as the Start Page.  Right-click on the service project and choose Set as Startup Project.  Press F5 to run the application.  You should see the test page for the service.  If you do then all is well, if not go back and fix any issues.  Make sure to close the web page when you are done here and set the client application as the Start Up Project again.

      image
    53. Okay now on to the client.  Since we have updated the service we need to update the Service Reference on the client.  This is easily done.  Simply right-click on ServiceReference1 and choose Update Service Reference.

       image
    54. You should see this dialog flash by:

      image
    55. We are almost done.  Now we just have to tell the client what protocol to use based on the binding name.  Remember when you set the Name of the TCP Binding to myTcpGoodness?  Well you did that to make this step easier for us.  Go to Module1.vb or Program.cs to see the code for your client application.
    56. Now we will pass the name of the binding to use in the constructor so that the client uses the protocol we want.  Change the code for creating an instance of the service to this:

      VB
      Dim myService As New ServiceReference1.ServiceClient("myTcpGoodness")

      CS
    57. ServiceReference1.ServiceClient myService =
                      new CoolServiceClientCS.ServiceReference1.ServiceClient("myTcpGoodness");

    58. Now just run your client application and you should see the predictable result.

      image
    59. At this point you are probably asking if it is REALLY using TCP.  It's easy enough to test.  From your command prompt type in the following:
      DANGER:  DO NOT RUN THIS COMMAND ON A PRODUCTION MACHINE UNLESS YOU LIKE GETTING FIRED!

      net stop w3svc
    60. You should see this:

      image
    61. You have stopped IIS and killed HTTP as an option for communicating to our service.  Now run the client application again.  Does it work?  Then you are in business!
    62. We are done but if you want you can add net.pipe to be used just like you did with net.tcp and see if it works.  Play with it and enjoy!  Oh yeah, you might want to type in "net start w3svc" from the command prompt to get IIS running again.  :P
  • The Ultimate Visual Studio Tips and Tricks Blog

    Visual Studio 2013: Turn Off the Uppercase Menu

    • 24 Comments

    NOTE: This is an older feature. I’ve updated the information for VS2013.

     

    This is one change to Visual Studio that I’m not a fan of and I still continue to see a ton of posts on this change so thought I would share here as well. 

     

    I always try to give credit where credit is due and I believe the earliest mention of this fix is by Richard Banks in his post 6\1\2012 here:  http://www.richard-banks.org/2012/06/how-to-prevent-visual-studio-2012-all.html 

     

     

     

    Mixed Case is Your Friend

    Okay so you really, really don’t like the Uppercase menu in VS2012 because you feel like it is shouting at you:

    5-16-2012 7-50-41 PM

     

     

    You would rather go back to mixed case for your menu:

    5-16-2012 7-43-08 PM

     

    Not a problem! Below are ways you can fix this feature in VS2013.

     

     

     

    Manual Registry Change

    WARNING:  Making changes to the registry can cause unexpected results so do any changes at your own risk!

    1. Open the registry editor and go to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\General\
      (For Windows 8 Express go to HKEY_CURRENT_USER\Software\Microsoft\VSWinExpress\12.0\General)
      (For Web Express go to HKEY_CURRENT_USER\Software\Microsoft\VSWDExpress\12.0\General)

    2. Create a new DWORD value called SuppressUppercaseConversion set to 1
      image

    3. Restart Visual Studio and you should see the change

    NOTE: Watch your spelling if you are typing this manually.

     

     

    PowerShell

    If you like to “simplify” this a bit you can use PowerShell to run a nice script to make this happen.  However, if you haven’t used PowerShell before this may not be faster for you.

    1. Go to the Start button or (Start Screen in Windows 8) and type powershell then select the Windows PowerShell Entry:
      image

      image

    2. In the PowerShell window copy the script below and paste it in then press Enter:

      Set-ItemProperty -Path HKCU:\Software\Microsoft\VisualStudio\12.0\General -Name SuppressUppercaseConversion -Type DWord -Value 1

      image 

    3. Restart Visual Studio and you are good to go.
  • The Ultimate Visual Studio Tips and Tricks Blog

    SQL Server vs. Access: Which is right for you?

    • 6 Comments

     

    This question came up the other day from Craig P. and I thought it was such a good one I wanted to blog about it.  I think many of us take it for granted that upgrading from Access to SQL is a natural progression but we sometimes forget the "why" of it all.  the bottom line is that sometimes the answer is to upgrade but sometimes the answer is to keep using Access.  Making informed decisions is important and being able to convince management plays a critical role to your success.  So with that I present two articles:

     

    1)  Microsoft Access or SQL Server 2005: What's Right in Your Organization?

    http://www.microsoft.com/sql/solutions/migration/access/sql-or-access.mspx

     

    2) And, to help compare SQL 2005 vs SQL 2008, "SQL 2005 vs. SQL 2008 Part 1"

    http://www.sqlservercentral.com/articles/Compression/62746/ 

     

    Yes, you have to register at that last site unless, of course, you use something like BugMeNot.com:  http://www.bugmenot.com/

  • The Ultimate Visual Studio Tips and Tricks Blog

    Set a Simple Breakpoint Condition

    • 5 Comments

    Menu:  [Right-Click the Breakpoint] -> Condition
    Versions:  2008,2010
    Published:  5/3/2010
    Code:  vstipDebug0021

     

    image  

     

    Did you know you can set Conditional Breakpoints?  They are arguably the most powerful among the types of Breakpoints you can set.  There are many layers to using them correctly and knowing is half the battle.

     

    Let's start with the Breakpoint Condition dialog.  Notice that the condition can be turned off by unchecking the Condition checkbox.  Additionally, there are two options for the condition that you set:

    "Is true" is used for Boolean expressions that evaluate to true or false. 

    "Has changed" means what it says - if the expression changes then the code stops.

    image 

     

     

    Suppose I have this "for" loop:

    image

     

     

    "Is true"

    I can set a simple "Is true" condition that says when the variable "i" is greater than, say, 5 the code should stop:

    image

     

    When I run the code and the Breakpoint is hit, sure enough, it stops when the value of "i" is greater than 5:

    image 

     

     

    "Has changed"

    This one is more interesting.  Basically you set up something to watch.  In this case, I'll just have it watch the "i" variable:

    image

     

    When the Breakpoint is hit and the value of "i" has changed in in any way then the code stops:

    image

     

     

    Special Notes

    Anytime you set an advanced Breakpoint you will get a new glyph:

    image

     

    You can always tell what kind of breakpoint you have by looking placing your mouse over the glyph and looking at the tooltip:

    image

     

    Or checking out the Breakpoints window:

    image

  • The Ultimate Visual Studio Tips and Tricks Blog

    Visual Studio 2013 Preview: Enhanced Scroll Bar

    • 16 Comments

    Visual Studio 2013 has another great new feature: enhanced scroll bar functionality. The new scroll bar will show cursor location, breakpoints, and much more! Let’s take a look.

    5-17-2012 12-51-16 PM

     

     

    Power Tools

    Before we begin I want to address where some of the new features in VS2013 are coming from. In Visual Studio 2013 many of the new features we put into the product were actually introduced via the Productivity Power Tools for Visual Studio 2012. This is an ongoing trend and you will see that many of the new features from future versions will come directly from the Power Tools. If you are still on 2012 you can get a lot of the newest functionality by installing the Visual Studio 2012 Power Tools which can be found here:

    http://visualstudiogallery.msdn.microsoft.com/3a96a4dc-ba9c-4589-92c5-640e07332afd

     

     

    Scroll Bar Options

    To really get a handle on the new scroll bar functionality the first thing you should do is Right Click on the vertical scroll bar and choose Scroll Bar Options:

    5-17-2012 11-57-37 AM

     

    You will see several settings that can be modified:

    5-17-2012 12-00-10 PM

    (NOTE: You can also get to this area by going to Tools | Options | Text Editor | All Languages | Scroll Bars)

     

     

    Show Scroll Bar

    5-17-2012 12-08-43 PM

    The first two options are pretty self-explanatory they will allow you to show or hide the scroll bars. For the most part you will leave these checked unless you have some special reason not to have them visible. 

     

    Display

    5-17-2012 12-12-18 PM

    The Display area allows you to turn on annotations that will show special items throughout the entire document within the scroll bar. This allows you, at a glance, to see where things like breakpoints and bookmarks are. We will look at these in the order you are most likely to encounter them but here is an example of the vertical scroll bar with annotations in it:

    5-17-2012 12-32-50 PM

     

     

    Show Caret Position

    5-17-2012 12-17-37 PM

    The first annotation you will most likely encounter is the caret position indicator. It simply shows the current position of the cursor with a blue line in the scroll bar.

     

     

    Show Changes

    5-17-2012 12-28-50 PM

    If you missed my blog post a couple of years ago on tracking changes in the editor, this is a good time to read it. You can find the post here:

    http://blogs.msdn.com/b/zainnab/archive/2010/04/14/track-changes-in-the-editor-vstipedit0048.aspx

     

    The Show Changes option simply shows the changes within it so you can see modifications at a glance for the entire document.

     

     

    Show Marks

    This options is fairly broad and covers several types of marks that can appear in code. Most notably this will show breakpoints:

    5-17-2012 12-42-29 PM

     

    Additionally, this will also show things like Bookmarks:

    5-17-2012 12-44-01 PM

     

     

    Show Errors

    The final indicator is arguably one of the most important. It shows any syntax errors the editor is aware of:

    5-17-2012 12-46-58 PM

     

    This let’s you quickly see where there are errors that need to be fixed before you compile your code.

     

     

    Behavior

    There are two behavior options for the vertical scroll bar: bar mode and map mode. So far everything we have seen is the traditional bar mode for the scroll bar. Now we will switch to map mode:

    5-17-2012 12-55-12 PM

     

    Map mode essentially turns your vertical scroll bar from this:

    5-17-2012 12-56-48 PM

     

    To this:

    5-17-2012 12-57-38 PM

     

     

    Source Overview

    Map mode is miniature look at your document so you can quickly get a feel for your code. There are four options for source overview when using map mode. I’ll show examples of the four views below. Of these the Off setting will be the most confusing until you see the Preview Tooltip in action so be patient.

     

    Wide

    5-17-2012 12-57-38 PM

     

    Medium

    5-17-2012 12-59-53 PM

     

    Narrow

    5-17-2012 1-00-50 PM

     

    Off

    5-17-2012 1-02-23 PM

     

     

    Preview Tooltip

    Regardless of which map mode view you use there is also an option to have the Preview Tooltip. Simply put your mouse pointer over any part of the vertical scroll bar and you will get a preview of the code at that position in the document:

    5-17-2012 1-09-33 PM

     

    Annotations

    All annotations previously mentioned also show up in map mode:

    5-17-2012 1-12-45 PM

     

     

    Go to a Specific Location on the Scroll Bar

    You basically have two options when you want to go to a specific location on the scroll bar. Let’s examine both ways.

     

    Left Click

    As long as you are in map mode:

    5-17-2012 2-39-51 AM

     

    You can simply LEFT CLICK any area on the scroll bar and you will jump to that location:

    5-17-2012 2-41-10 AM

     

    For this reason, I suggest, even if you don’t want the map, that you at least use map mode set to Off to get this functionality so you can quickly move around using the scroll bar:

    5-17-2012 2-44-42 AM

     

     

    Scroll Here

    Now that you have a solid base level of knowledge for this feature there is one more important item I want to show you: Scroll Here. If you find any place that is interesting to you in the vertical scroll bar and want to quickly go to that location you can simply Right Click the location and choose Scroll Here:

    5-17-2012 10-12-17 PM

     

    The new location will come into view so you can begin looking at the code:

    5-17-2012 10-13-50 PM

     

     

    Finally

    The enhanced vertical scroll bar is a great tool for developers to quickly see places of interest and to examine those locations. Try this feature out and see if you like it as much as I do. :)

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