Standoff between me, my bike, and wildlife creature captured on my Windows Phone

Seems that whenever I bring my Windows Phone with me on a bike ride, something unusual happens.

I’m doing a well-known bike loop in the area, when I realize I’ve made a wrong turn. I stop and check where I am on the “Maps” app. Sure enough, I’m at the exact center of the loop. Not half way around the loop, but directly bullseye. Only me.

I use this time to refuel (Gu gel, Heed sports drink) when I hear a very disturbing noise from the woods across the street. I’m in a rural area with very few cars and houses, so it’s not surprising there’s wildlife so close to roads. But whatever this thing is, it’s big and moving closer to the road.

Having lived in Seattle for a while, I worry it’s a cougar, a small mountain lion that attacks people if they feel threatened. You’ll hear stories on the local Seattle news of hikers or runners who have disappeared on trails, and a lot of the time the authorities suspect a mountain lion or some other wildlife.

I immediately consider running for it, since I have my bike. But, I’m surrounded by small hills, so I quickly abandoned the idea of a quick getaway.

The noise is very loud, moving very fast, and is headed straight for me.

Seattle hiker advisories say “If a mountain lion attacks, fight back aggressively.” I pick up my road bike. I’m betting the bike is going to be lightweight enough to use as a weapon. It’s not like I have anything else to bet on. Whatever this creature, mountain lion, ManBearPig is, it might get me at the end, but I’ll make sure it limps away very injured.

The noise explodes. The creature emerges. It looks me directly in the eyes.

I drop my bicycle in relief. It’s just a deer.

Trying not to shake too badly from the adrenaline rush, and not to mention the Gu gel w/ caffeine, I grab my Windows Phone and start taking photos. I unlock the phone and press the “Camera” button on the side to load the camera. Then I press the Camera button a few more times to grab some photos. This is my first time taking pictures with the Windows Phone at the drop of a dime. I have to say compared to my previous BlackJack, I was happily surprised I was able to capture this vicious creature and it’s squadron.

Leader deer crossing road

There were 4 deers total, hence why the creature sounded huge and ferocious in the woods.

2 more deers crossing

Final deer crossing road

Can’t wait to see what adventure my Windows Phone brings me next time!

SQL Server Compact Toolbox – Extension #12

Today’s post comes from Guest Blogger Erik Ejlskov Jensen, SQL Server Compact MVP, @ErikEJ

Toolbox for SQL Server Compact developers

If you use SQL Server Compact, Microsoft’s embedded database for devices, desktops and soon ASP.NET, this extension is for you.

It adds several features not found in Server Explorer Data Connections:

  • Support for both version 3.5 and 4.0 database files
  • Script tables, including data
  • Script entire schema, optionally with data, both of SQL Server Compact and SQL Server 2005 or later databases
  • Import to SQL Server Compact from a SQL Server 2005/2008 database or a CSV file
  • Basic, free form query execution, with Excel friendly output
  • Parse SQL scripts
  • Display graphical estimated query plan
  • Generate detailed DGML files for visualizing table columns and relationships (requires VS 2010 Premium or higher to view)
  • Create and manage SQL Server Merge Replication subscriptions


To install

To use

To start using the add-in, go to Tools, and select SQL Server Compact Toolbox:


The add-in will list any version 3.5 database connections, which you have defined in Server Explorer. For 4.0 (which is currently not supported in Server Explorer, but will be so in VS 2010 SP1), you can add a connection from the context menu (or even create an empty 4.0 database file):


To refresh the listed connections, click the refresh button on the add-in toolbar.

Scripting an entire database

To create a SQL script file with all object definitions and data in your SQL Server Compact database (for documentation, backup or migration use), select “Script database schema and data” from the context menu:


Viewing estimated execution plan

To find out if you are missing indexes in your database, you can examine the graphical estimated query plan.


With the SQL editor open, press Estimated Plan:


It looks like an index is used here, which is a “good thing”.

Displaying a graphical view of your database

From the database context menu, select “Create Database Graph (DGML)”


This will allow you to explore an interactive graph of your database tables, relationships, and columns:


More information

You can submit feedback/patches, request features and browse/download the source code at the CodePlex site: – and keep up to date with the latest SQL Server Compact news on my blog: Everything SQL Server Compact

Have you written an extension? Want to see it featured here? Let me know!

9 years at Microsoft

Today marks my 9th year at Microsoft. Next year, I’ll collect my second Final Fantasy crystal.

I thought it would be fun to share a few blogging statistics:

It’s tradition to recap the teams you’ve worked on over the years…

  • QA on the Environment SDK (also known as VSIP, VS SDK, VS Extensions). The first feature I ever tested was “devenv.eve /safemode”
  • Learned how to do Accessibility Testing – worked without a monitor for 3 months (seriously, I listened to a screen reader) when i first joined Microsoft
  • QA on the Profiles feature (Tools – Import / Export Settings) – my first feature I worked on from design to launch
  • QA on the Extensibility team (add-ins, macros, recording macro).
  • QA on the Core IDE team (Window Management)
  • Started blogging here in October of 2003 (content was moved a few months later here)
  • Drove the Accessibility Effort for Visual Studio 2005
  • Assisted driving the User Experience Consistency Effort for Visual Studio 2005
  • QA on the Editor team (core Editor functionality)
  • QA on the Project / Solutions team, completing a tour of all the Visual Studio feature areas (okay, okay, i didn’t own Help, but i helped analyze test case failures when those owners were out of office)
  • Program Manager on the Developer Solutions (aka Power Toys) team, releasing 3 of the first 28 projects on when the site went public back in 2006.
  • Kicked off the Visual Studio Tip of the Day series
  • As a hobby, I assisted teams within Visual Studio in releasing to CodePlex by authoring a framework for what sorts of releases go where and how to get them to the outside world.  Even received a ThinkWeek review by Bill Gates.
  • Program Manager for First got my account back in early 2006. Joined as PM when site had 2800 projects.
  • Achieved 4 of my childhood dreams: Rode on a Mardi Gras float, Held a Koala, Got To Be In That Number When the Saints Went Marching In!, and got my 2nd degree black belt. Only 2 dreams left to go: Buy a DeLorean and Do an Ironman.
  • Achieved 2 of my professional dreams; Wrote my first book and started a college scholarship for folks back home; Got to be in a TechEd Keynote (in Australia)
  • Overcame 1 of my biggest nightmares: Jumping from a Tall Building
  • Left after watching 10,000 Open Source Projects get created as the Program Manager
  • Finally moved to California after 81 months without seeing the Sun. No joke! 9 months of gray * 9 years = 81 months.
  • Now a Developer Evangelist for Silicon Valley who can demo 101 Visual Studio features in exactly 55 minutes ;-)

It’s also tradition to bring in a pound of M&Ms for each year at MSFT. Since my team is scattered across the west coast, I’ll bring my 9 pounds of M&Ms to SuperHappyDevHouse on Saturday.

Thanks everyone for a fantastic 9 years!

Solution Explorer Tools (When to Sync to Current File) – Extension #11

Control when Solution Explorer syncs to the current file

I’ve given many talks on Visual Studio, and one of the most popular questions is about controlling when Solution Explorer syncs to the current item. This extension is the best one I’ve seen in providing this functionality.

To Install

You can find the Solution Explorer Tools extension at

To Use

First, you must disable the “Track Active Item in Solution Explorer” in Tools – Options – Projects and Solutions – General page.

Track Active Item in Solution Explorer option disabled

Now the fun can begin.

On the Solution Explorer, you’ll see 3 new icons.

New commands on Solution Explorer

Starting right from left:

  1. Sync Item – sync’s the Solution Explorer to whatever document is open (or the last active item if a tool window is in the file tab channel).
  2. Collapse All – recursively collapses everything in the solution explorer
  3. Collapse to Item – this combines the previous commands. This will sync to the currently opened item and collapse everything else.

You can also bind keyboard shortcuts to each of these commands via the Tools – Options – Keyboard page:

  • Project.SyncItem
  • Project.CollapseItem
  • Project.CollapseToItem

Some keyboard shortcut suggestions are to bind Project.CollapseToItem to Ctrl+Alt+semicolon, since it is right next to the Ctrl+Alt+L keystroke that opens the Solution Explorer. If you really like this feature and want it on all the time, you could bind it to Ctrl+Alt+L, overriding the standard Open Solution Explorer commands, so the Solution Explorer will always open and collapse to the current item.

Just double-check what your keyboard shortcuts are bound to, as your settings may be different than mine.

More information

Check out the extension’s gallery page at

Windows Phone 7 Developer Launch Events

For those outside of Northern California or can’t make these dates, you can watch our launch event live on Oct 12 from Mountain View.

Attend either day or both days!  Note that Day 2 is all Hands-on Labs, and no presentations. More information about each day below.


Mountain View, CA | Microsoft Silicon Valley Office | October 12 – 13, 2010

San Francisco, CA | San Francisco Design Center | October 20 – 21, 2010


Day 1: Jump-Start Your Mobile Development | 8:30am – 5:15pm
In the first of this two-day launch event, we’ll take you under the hood of Windows Phone 7 and the Windows Phone 7 platform with a progressive set of learning sessions. We’ll start with the basic tools and fundamentals of Windows Phone 7 application development and as the day unfolds, we’ll go deeper into development scenarios using Silverlight, XNA and the Windows Phone 7 SDK. You’ll also see how to earn cash for your apps in the fully loaded Marketplace.

Day 2: Unleash Your Best App Workshop | 9:00am – 4:00pm
This hands-on workshop is designed to help you turn those napkin sketches and subway scribbles into real, sellable apps. You’ll apply fundamental Windows Phone 7 design principles to build an app and upload it to the fully revamped Marketplace. Go at your own pace or follow along with a proctored group lab. Either way, you’ll get step-by-step advice from Microsoft and community experts. It’s an unprecedented opportunity to stake your claim in the marketplace – using familiar tools and consistent specs.

Emacs Commands – Extension #10

Use your Emacs commands once again!

If you have opened the Tools – Options – Keyboard page, looking for the “Emacs” keybindings, but only found disappointment instead.

Emacs in keyboard scheme options

This extension is for you!

To Install

To Use

In order to finish the installation, you must open/create a project. This will prompt you for elevated permissions to finish installing the Emacs.vsk file (the emacs keyboard shortcut file) to the Visual Studio IDE folder located under Program Files (hence the elevated permissions since you need to be an admin to get in here on the file system).


Once a project is opened, you’ll see the Emacs item in the Tools – Options – Keyboard scheme dropdown.

Emacs in keyboard scheme options

Quick Primer on Emacs

For those new to Emacs, here’s a quick example how it works in Visual Studio. (This is the way Emacs was explained to me 10 years ago.)

The “big” key is the Alt key.

The “small” key is the Ctrl key.

If you want to navigate forward, just letter by letter, you press Ctrl+F (small Forward). If you want to navigate backward, just letter by letter, you press Ctrl+B (small Backward).

If you want to navigate forward, word by word, you press Alt+F (big Forward). If you want to navigate backward, just letter by letter, you press Alt+B (big Backward).

My favorite part of using Emacs was the ability to move up and down without having to reach for the arrow keys (Ctrl+U, Ctrl+D).


I’m calling out the uninstall because it looks like when you disable or even uninstall the extension, the Emacs option still remains selected in the Tools Options Keyboard list. You must go back to Tools Options Keyboard and select the “(Default)” keybindings.

Selecting Default on the keyboard mapping scheme

Since it required admin rights to add it, you’ll need admin rights to remove it. And i’m guessing if the extension waits until a project is opened to prompt you for these permissions, there isn’t a place for the extension to prompt you to remove the .vsk file. (you can’t be prompted the next time you open a project because the extension is gone.) But that’s just my guess.

If you forget this step, you’ll notice a great many things not working, like Ctrl+F. Since in the Emacs keybindings that’s bound to a command that no longer exists in VS, you’ll won’t see Quick Find dialog. Simply go to Tools Options Keyboard and select Default, and VS will be right as rain.

You can always manually delete the Emacs.vsk file yourself at your own risk.

More Information

You can find more information on all the Emacs keyboard shortcuts supported by the extension at the bottom of this post.

VS File Explorer – Extension #9

Get a Windows Explorer experience within the IDE!

My series continues with the VS File Explorer. I call this extension out because of its tag line:

The Visual Studio File Explorer Add-in (sexy name we know, but hey, it’s self documenting)

Gotta love self-documenting Add-in names. Rock on.

Seriously, it was the Shell Extension within Visual Studio experience that grabbed my attention. See below.

To Install

The VS File Explorer extension can be found in the Visual Studio Gallery at

To Use

The tool can be found at View – Other Windows – Mindscape File Explorer.

View - Other Windows - Mindscape File Explorer

This will open a tool window that has a Windows Explorer look-and-feel.

But a Windows Explorer in itself isn’t exciting. There’s some additional functionality that’s worth calling out.

Maybe there’s a feature here that will help improve your productivity.

Shell Extensions within Visual Studio

Let’s say I have a shell extension like TortoiseSVN. (Tortoise doesn’t have a GUI per se. It inserts itself into Windows Explorer.) Using VS File Explorer, you can now see TortoiseSVN within Visual Studio.

TortoiseSVN shell extensions within VS

Just a heads up, for you 64-bit users, you might want to read this thread. (You need the 32-bit version of Tortoise to run within VS).

Command Prompt Here

This command will open a command prompt, regardless whether the selection is in the right-pane or left-pane.

Command Prompt Here icon

But note, this by default will be your standard command shell, cmd.exe, and not the Visual Studio Command Prompt. There is an option to customize what is run when you press this button.


Home icon

I had to ask Mindscape about this one.

The “Home” button will change the root folder to whatever the “Default Root Folder” is in the Options dialog.

However, seems that there’s a bug that you have to change the “Default Root Folder” to something other than the installed default in order for the “Home” button to do something. Otherwise, trying to click “Home” will cause Visual Studio to stare at you like an old dog in obedience class looking at you as if you actually expect him to fetch that ball.

Snap to Current Solution

At first glance, I thought “snap” would take the highlighted project/code and add it to the current solution. Mais non!

“Snap To Current Solution” changes the current root folder to the current solution folder. As shown below, my Code default root folder becomes ConsoleApplication1

example of "Snap To Current Solution"

Change Root Folder

Change Root Folder icon

Not to be confused with the “Default Root Folder” setting, this command just changes the current root folder view in the left-pane. It doesn’t change the “Default Root Folder”, the folder that “Home” will go to.


Options icon

Just as it sounds, here be anthropomorphic dragons, i mean here is where all the settings live for the VS File Explorer.

There are four settings here

  • Default Root Folder – What the “Home” button will take you to
  • Excluded Files – the files the VS File Explorer should not show
  • Open In Visual Studio – what do you want to happen when you double-click or press “Open” on a .sln file? Do you want VS to open it, or do you want it opened by its default application.
  • Command Prompt – here’s where you can change the .exe that is executed. For example, I changed mine to \Windows\System32\notepad.exe. Now when I click the command prompt icon, I get notepad. Might be able to do some interesting things here.

Know of an Extension you’d like to see here. Let me know!

Power Commands for Visual Studio 2010 – Extension #8

I’m way behind in my extension series. Relocation + New Job + Work Travel, it’s been a crazy year!

The Power Commands for Visual Studio are back! The Power Commands were an extremely popular add-in for Visual Studio 2008, giving you even more options for your IDE.

To Install

The Power Commands extension can be found on the Visual Studio Gallery at

Please see this post on how to install extensions if you need additional help.

To Use

The Power Command options can be found all throughout the IDE. To help you discover what all the Power Commands do, I’m going to review each option below.

Pay close attention to the Choose Which Commands You Want To Use section. All commands are enabled by default, but if there are a few you never will use, or don’t want to use, you can disable them in Tools Options.

Format Document On Save

Ctrl+K, Ctrl+D is the keyboard shortcut to format the current document (found under Edit – Advanced – Format Document). This is very useful to know when you cut and paste code from a website or somewhere else that causes the formatting to go crazy.

But maybe you don’t want to think about keyboard shortcuts. Or maybe you just one less thing to worry about as you save the document.

You must enable the “Format Document On Save” option at the Tools – Options – PowerCommands – General page.

Now whenever you save a document, and formatting that’s off, as shown below

extra whitespace on line

will be corrected automatically.

corrected whitespace

Remove And Sort Usings On Save

Alas, this is only for C#. On the C# context menu, there are the “Organize Usings” commands.

Remove and Sort Usings on context menu

These options are great when you want to clean up your using statements at the top of the file, by removing any using statements not actually being used and also by sorting them in alphabetical order.

non-sorted using statements

Talk about a huge timesaver!

But let’s save even more time by having the editor do this automatically whenever you press save. You can find the option to enable this feature at Tools – Options – PowerCommands – General page.

Remove and Sort Usings

Let’s take this awesome one step further. Instead of removing unused using statements at the file level, let’s remove and sort them at the project level!

Remove and Sort Usings on context menu

As illustrated above, the command “Remove and Sort Usings” can be found on the Solution Explorer context menu at both the Solution level and at the individual project levels.

Clear All Panes

In the Output Window, you can have multiple panes, the most common being Build and Debug. There’s a “Clear All” button (indicated below) that will just clear the current output window pane.

If you want to clear all output sub-windows at once, press the “Clear All Panes” button located just to the right of the “Show Output From” drop down.

Clear All Panes on Output Window

Copy Path

No more having to open a file to copy its file path from the file tab.

This command copies the full path of the currently-selected item to the clipboard. It works with the solution node, a project node, any project item node, and any folder.

Copy Path on Solution Explorer context menu

Email Code Snippet

Exactly as it sounds.

Select some code in the editor, then right-click and select “Email CodeSnippet.”

Email CodeSnippet on context menu

And it also fills out the subject for you.

To: You
From: Me
Subject: CodeSnippet from Program.cs

Insert Guid Attribute

To add a GUID attribute to a class, right-click anywhere within the class and select “Insert Guid Attribute”, and those few extra keystrokes are done for you.


Show All Files

The only thing better than one “Show All Files” button is two “Show All Files” buttons! The one on the left is for the current project, but the one on the right is for the entire solution.

current project versus entire solution icons

Undo Close


How many of you like me close something only to realize in that instant that you wanted to look at something again. This command is for us!

To reopen the most-recently closed document, go to Edit – Undo Close. Keyboard shortcut is Ctrl+Shift+Z. It’ll even return the cursor to its last known position.

But it gets better…

Want to see all of your most-recently closed documents? Go to View – Other Windows – Undo Close Window.

Undo Close tool window

Collapse Projects

If you want to collapse everything under a project node, including any sub-nodes (this being the key difference from the standard Windows behavior), right-click and select “Collapse Project” from the Solution Explorer context menu.

Thus a project like this

fully expanded node in Solution Explorer

will collapse everything, including the Properties and the Resources.resx nodes, as shown below. (I expanded the XAMLVisualizer node for illustration purposes).

collapsed sub-nodes in Solution Explorer

This command works for solutions, projects, and solution folders.

Copy Class / Paste Class

On the Solution Explorer, select a project item (usually a class file) you want to copy. Right-click and select “copy class.” Now navigate to the project node and right-click to see the “Paste Class” command.

a copied class in solution explorer

It will also rename the class to avoid compiler errors.

Copy References / Past References

This command allows you to copy all your references for a project, then paste them into another project. No Add Reference Dialog needed!

Copy References on Solution Explorer

You can also do this across multiple instances of the IDE.

For C# projects, the command is found on the references node. For VB and ASP.NET projects, it is found on the project node.

Copy As Project Reference

Just like in the previous command, why use the Add Reference Dialog if you don’t have to. The “Copy As Project Reference” command found on the Solution Explorer context menu will allow you to copy a project (from its project node) and then paste it into another project node as a project reference.

Copy as Project Reference example

Edit Project File

One of my more popular tips, especially for those who work on MSBuild project files, is the ability to quick edit your project files without having to shut down Visual Studio and open up notepad. The tip was to Unload Project and Edit Project (all via Solution Explorer context menu).

The “Edit Project File” combines these two commands for you, unloading the project and opening the file in the editor for you.

Edit Project File in editor context menu

You’ll still need to Reload the project file when you’re done. The command is found by right-clicking on the project node.

Open Containing Folder

Similar to the command found on the File Tabs and in the Solution Explorer for a node, this command opens the containing folder for an item in the Solution Explorer.

Open Containing Folder on Solution Explorer context menu

Open Command Prompt

For The Win!

Open a Visual Studio command prompt directly from the Solution Explorer! I say a “Visual Studio” command prompt, and not just a command prompt, because this one has the Environment Variable set to know where devenv.exe lives. So no more having to be frustrated with “devenv is not recognized as an internal or external command….”

Open Command Prompt via Solution Explorer

Unload Projects / Reload Projects

Similar to the built-in command for unloading a project, the Unload Projects command (found on the Solution Explorer context menu for a project node) will unload all the projects in a solution. Useful for editing multiple MSBuild files.

Unload multiple projects example

And to reload all your projects, there’s the Reload Projects command.

Extract Constant

Found under the Refactor menu, the Extract Constant will do exactly what it sounds like it does. It will create a constant based on the selected text. For example, consider the Console.WriteLine() parameter I have below:

Extract Constant on context menu

Selecting this text, I can specify “Extract Constant”. It will bring up a dialog to allow me to specify scope and give the new string a name.

Extract Constant dialog box

Pressing enter creates the string, the WhoDat constant in this example.


Clear Recent File List

No longer having to go to the registry to clean up your recent files list. The “Clear Recent File List” command will do that for you. Go to File – Recent Files – Clear Recent File list.

Clear Recent File List on File - Recent Files menu

This will bring up the Clear Recent File List dialog for you to pick and choose what to delete.

Clear List dialog box

Wow! I have a lot of recent files!

Clear Recent Project List

Similar to the above tip, the Clear Recent Project list will allow you to clean up your recent project list. It is found at File – Recent Projects and Solutions – Clear Recent Project List.

Clear Recent Project List dialog box

Close All

Found on the File Tab context menu, this command will close all open documents.

Close All on File Tab Context menu

Choose which commands you want to use!

By default, all the power commands are enabled. To only enable those you’re going to use, you can go to Tools – Options – PowerCommands.

Tools - Options - Power Commands - Commands

And on the Commands page, you’ll find the full list of all the commands available with this extension.

All possible PowerCommands options to enable/disable

The Rematch – Webcast of my 101 VS tips in 55 mins via O’Reilly is now available

Earlier this week, I decided to rematch the clock to demo 101 VS Tips in 55 minutes with O’Reilly Media hosting and recording the webcast. In an earlier attempt, I missed by 15 seconds. And like the earlier attempt, if I make it, all attendees receive a free copy of my Visual Studio Tips ebook. 

The Rematch —>

Did I make it this time? Let’s just say a picture speaks a thousand words.

stop clock with 6 seconds remaining

Actually, I demo’ed #102 tips, because I started off with Tip #0. ;-)

Since I entered hyperspace in the final 2 minutes, some folks were asking what were those last tips. The order is the same as the Channel 9 version of the talk as well.

Here’s the breakdown:

  • #97 – How to see caught exception in Watch Window
  • #98 -? You can disable the Exception assistant
  • #99 – How to use the Intellitrace DVR controls (The lack of oxygen to my brain made me call it by its old name – Historical Debugging)
  • #100 – How to open an IntelliTrace? Log (I miscalled this tip 99)
  • #101 – How to use Extension Manager / Get VS Tips in your start page. Yeah, you need to set it up in the Tools – Options – Environment – Startup.

And to that comment at 15:30, I was so tempted to say something in response, but I didn’t want to waste my precious time on Brett Favre. =P

If you want to find out more about O’Reilly’s webcasts, you can visit Thanks again to O’Reilly for hosting and for providing the ebooks!

5 years later – remembering Hurricane Katrina

I wanted to pause for a brief second to remember the 53 people in my hometown who lost their lives 5 years ago yesterday, when Hurricane Katrina took my hometown off the map.

If a town doesn’t have any buildings, is it still a town? Waveland answered that question by surviving.

For those of you who have just recently met me, this post is mostly a FYI. But for those of you who have been following me throughout Katrina, I know I sound like a broken record, but I’ll never be able to thank you enough.

My Parents on NBC Nightly News

And once again, my parents were featured on NBC Nightly news for the 5 year anniversary.

“Living through hell prepares you for anything life throws at you.”

Quote taken from a friend’s blog post regarding an outsider’s perspective on the storm. Amen.

Save Waveland Scholarship Fund

Just wanted to remind folks that they can still donate directly to the scholarship fund I created from my Visual Studio Tips book royalties.


Photo found here. Annotations are mine.

Is New Orleans / Waveland rebuilt?

I guess it depends on what you mean by “rebuilt?” If rebuilt means “back the way it was” then the answer is a definitive no. In many places it has rebuilt, but it many, many different ways. And in many places it still 5 years later looks like Katrina just happened.

But every time I go home, things are looking better and better.