The opinions expressed in these materials are my own and are not necessarily those of Microsoft.
Copyright © Microsoft Corporation. All rights reserved. Unless otherwise indicated, all source code provided is licensed under the Microsoft Public License (Ms-PL).
Menu: Tools -> Options -> Projects and Solutions –> General Commands: View.TrackActivityinSolutionExplorer Versions: 2005,2008, 2010 Published: 3/29/2010 Code: vstipProj0011
Note: Several people have asked if you can turn this feature on and off at will. You can if you bind the View.TrackActivityinSolutionExplorer command to a keyboard shortcut.
By default, VS2010 will track the current file you are editing in Solution Explorer. It looks like this:
Notice that the current file being edited is also selected in Solution Explorer automatically. This is a great way to keep track of where you are in the solution when you are working with a lot of files. You can turn it off if you want. Just go to Tools -> Options -> Projects and Solutions -> General -> "Track Active Item in Solution Explorer" and uncheck the option to turn this feature off.
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):
If you click anywhere inside the file the tab will go from grey to purple to distinguish it from regular (blue) tabs:
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:
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.
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:
The most likely approach is you will just double click the file in Solution Explorer or whatever results dialog you happen to be in.
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.
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.
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.
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:
This will take you to Tools | Options | Environment | Tabs and Windows:
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.
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.
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.
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:
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:
You will see several settings that can be modified:
(NOTE: You can also get to this area by going to Tools | Options | Text Editor | All Languages | Scroll Bars)
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.
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:
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.
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:
The Show Changes option simply shows the changes within it so you can see modifications at a glance for the entire document.
This options is fairly broad and covers several types of marks that can appear in code. Most notably this will show breakpoints:
Additionally, this will also show things like Bookmarks:
The final indicator is arguably one of the most important. It shows any syntax errors the editor is aware of:
This let’s you quickly see where there are errors that need to be fixed before you compile your code.
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:
Map mode essentially turns your vertical scroll bar from this:
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.
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:
All annotations previously mentioned also show up in map mode:
You basically have two options when you want to go to a specific location on the scroll bar. Let’s examine both ways.
As long as you are in map mode:
You can simply LEFT CLICK any area on the scroll bar and you will jump to that location:
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:
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:
The new location will come into view so you can begin looking at the code:
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. :)
This post is a bit overdue but better late than never. So let’s talk about Visual Studio Update 1…
Soma originally introduced Update 1 in his November 26th post here:
Since some of you may want to install this update immediately there are a few options for you.
From inside the IDE, go to Tools | Extensions and Updates:
Then look under the updates section and install from there:
If you want a more direct route you can click this link: http://go.microsoft.com/?linkid=9821199
You will get this dialog and can just click Run to execute the small .EXE and begin the online install:
Although many believe you can only install via online resources this is actually not true. A quick look at vsupdate_KB2707250.exe /? shows us the /layout switch:
So when I run vsupdate_KB2707250.exe /layout c:\ziptemp\vsup1 on my system this is the dialog I get:
This will download the source files to the designated location so you can make them available on a network share, thumb drive, or other media for stand-alone installation.
The most obvious question is, “Why should I care?” Despite the bug fixes and new features, this particular update represents a major shift in the timing for delivery. We have now committed to a shorter update cycle so we can deliver critical fixes and incorporate new features more quickly. What this means for you in real terms is that blocking issues may be resolved much more quickly and/or you will get a new feature that will help you get work done better/faster/stronger.
So what exactly did we deliver? Fundamentally there were two things we provided: Bug Fixes and New Features. You can find all the details here:
I’m going to repeat the bug fixes here and then address the new features in another article right after this one.
After an extended period of time looking for the list of bug fixes included in the package I was initially unable to find a comprehensive list anywhere. It looks like the team recognized there was a gap and updated the KB article on 1/13 to include all the relevant information. I’ll just repeat the information here verbatim for convenience.
Menu: Project -> Add New Solution Folder; [Right-Click Solution] -> Add -> New Solution Folder Command: Project.AddNewSolutionFolderVersions: 2008,2010Published: 3/27/2010 Code: vstipProj0009
Did you know there are special folders to help you organize large solutions? There is! They are called, appropriately enough, Solution Folders. To create one just Right-Click on your solution (or go to Project -> Add New Solution Folder) and you will see this in Solution Explorer:
Simply give the folder a name and you are good to go. But so what? I mean, what can you actually DO with these things? Here is a list of stuff you can do:
Move or add projects to them. Solution Folders can be nested to create greater organizational structure.
Add, delete, or rename Solution Folders at any time, if the organizational requirements of the solution change.
Unload all projects in a Solution Folder to make them temporarily unavailable for building.
Collapse or hide entire Solution Folders so that you can work more easily in Solution Explorer. Hidden projects are built when you build the solution.
Build or rebuild all the projects. The projects are built in the order specified by the project dependencies.
Solution Folders are an organizational tool in Solution Explorer; corresponding Windows folders are not created. Microsoft recommends that you organize your projects on disk in the same way that you organize them in the solution. But that is your call :)
Keyboard: CTRL + SHIFT + F Menu: Edit -> Find and Replace -> Find in FilesCommand: Edit.FindinFilesVersions: 2008,2010Published: 1/3/2010Code: vstipFind0002
You can customize your Find in Files results to show what you want to see and how you want to see it.
Example: You don't want to view the entire file path shown in the Find Results tool window.
So instead of this:
You want this:
No problem! :)
DANGER: This involves hacking the Registry so use this tip at your own risk!
Here are valid values you can use in the string:
$v drive/unc share
$x end col if on first line, else end of first line
$L span end line
$C span end col
$0 matched text
$t text of first line
$s summary of hit
$T text of spanned lines
Shoot me the URL to your blog and point out where you have linked to me. I will pick one lucky victim...er...winner to reward with a Visual Studio 2008 Backpack or 3 Visual Studio T-Shirts.
Welcome to the Launch Landing Page on my blog! Here you will find all kinds of launch-related coolness for your use.
Visual Studio Team System 2008 Virtual PC Images
Hands-On-Labs -- These things rock they are the harcore labs that you can do to get up so speed with the products.
[UPDATE: apparently there are source files missing from the hands on labs above so they are basically PDFs that suck. You can grab them as a nice overview but use the link below for labs with source files you can actually use:
And here you can find related webcast/podcasts/etc...: http://www.microsoft.com/events/series/msdnvs2008.aspx?tab=virtuallabs ]
Now to the good stuff! here are the links to videos from the Dallas Launch. Enjoy!
Links to Session Videos:
Ø Keynote, Chris Sakolosky, Jon Roskill
Ø Virtualization and your Infrastructure, John Weston
Ø Exploring Windows Server 2008 Web and Application Technologies, John Weston
Ø Optimizing your IT Infrastructure with Windows Server 2008, Stephanie Doakes
Ø What is New in Windows Server 2008, John Weston
Ø Securing your IT Infrastructure with Windows Server 2008, John Weston
Ø Enabling Dynamic IT and Optimizing your infrastructure processes and people, Stephanie Doakes
Ø The Application Platform: Where IT meets business, Stephanie Doakes
Ø Exploring Business Intelligence and SQL Server 2008, Brad Nelson
US Premier Launch Dallas MSDN Event Page:
Ø Simplify Management of Data Infrastructure, Sri Sridharan
Ø Breakthrough Challenges with Visual Studio 2008, Chris Koenig
Ø Creating Instantly Familiar Applications with Office System, Zain Naboulsi
Ø Mission Critical Application in SQL Server 2008, Sri Sidharan
Ø Next Generation Data Applications, Jonathan Swartz
Ø Reach end Users with Next Generation Web Applications, Chris Koenig
Ø Defy Occasionally Connected Challenges with Smart Client Applications, Zain Naboulsi
Yep, it's that time again. I feel the urge to purge some swag and what better way to do it than with a contest?
(Seriously cool image from http://www.techshout.com/)
To celebrate the coolness of Vista and Office 2007, I have decided do something around these products...but what?
I think it would be cool to have YOU decide what the contest should be. Hit me with YOUR suggestions for a contest that would be challenging yet fun to do.
[update 10/27/2008: we have finally decided on what the contest will be and the details can be found here http://blogs.msdn.com/zainnab/archive/2008/10/27/contest-phase-ii-begins.aspx you have until Nov. 21st to submit your entry]
The prizes will be:
1st Place: 4 vouchers for 50% off MS exams
2nd Place: 2 vouchers for 50% off MS exams
3rd Place: 1 voucher for 50% off MS exam
Combined with the goodness I announced earlier (http://blogs.msdn.com/zainnab/archive/2008/10/15/microsoft-learning-love-get-your-test-on.aspx) I think this will be a VERY cool deal for some folks.
So, the first phase is, based on your suggestions, I will create a contest and then the winners of that contest get the prizes listed above. Sound cool? Then get me some contest suggestions!!
Keyboard: CTRL + ALT + K (anywhere); CTRL + K,T (cursor must be on a member name) Menu: View -> Call Hierarchy Command: View.CallHierarchy; EditorContextMenus.CodeWindow.ViewCallHierarchyVersions: 2010Published: 1/19/2010Code: vstipTool0005
For the C# folks this is one heck of a great feature: The Call Hierarchy. It allows you to visualize all calls to and from a selected method, property, or constructor. To see how it works just right-click on any method, property, or constructor in the Editor and select View Call Hierarchy:
You should get a window similar to this one (amount of information will vary):
Notice there are "Calls To" and "Calls From" areas related to your selection. You can expand them out:
When you click on a node in the tree, the Call Sites window updates so you can visit the call if you want to:
You can continue expanding the hierarchy to see more "Calls To" and "Calls From" information:
The best part is you can right-click on a symbol and get all kinds of options:
Here are some options you may come across:
Context Menu Item
Add As New Root
Adds the selected node to the tree view pane as a new root node.
Removes the selected root node from the tree view pane. This option is available only from a root node.
You can also use the Remove Root toolbar button to remove the selected root node.
Go To Definition
Runs the Go To Definition command on the selected node. This navigates to the original definition for a method call or variable definition.
You can also press F12 to run the Go To Definition command on the selected node.
Find All References
Runs the Find All References command on the selected node. This finds all the lines of code in your project that reference a class or member.
You can also use SHIFT+F12 to run the Find All References command on the selected node.
Copies the contents of the selected node (but not its subnodes).
Collapses the selected node so that re-expanding it displays current information.