Did you know… You can use team settings to keep Visual Studio settings on different machines in sync – #248

Under Tools – Options – Environment – Import and Export Settings, you’ll see an option called Use team settings file.

The idea is that you want all the members of your team to use the same baseline set of settings.  You can provide a .vssettings file (by creating these customizations on your machine, then doing a Tools – Import / Export Settings – Export to create the file), and put the .vssettings file out on a UNC share.  Next, you check the Use team settings file, pointing it at this file.

Use team settings file Tools option

So, what happens now?  Whenever Visual Studio launches, it’ll check the time timestamp of the .vssettings file, and if there’s been an update, VS will reapply all the settings from the .vssettings file.

I think that this works really well in the scenario where there’s a single developer who works on multiple computers, because any tweaks you make on one machine will be carried over to the next machine.

Technorati Tags: VS2005Tip,VS2008Tip

Happy Birthday CodePlex!

Today is the 2nd anniversary of the CodePlex launch announcement.  I brought in some birthday cake on this nice, warm and sunny Friday afternoon in Seattle.

CodePlex Team Members

CodePlex team members who are not currently on vacation.   We have a few who are out of office right now.

And yes, i’m wearing one of the Microspotting t-shirts.

DSC02437

And a picture of our half-eaten birthday cake.  I have got to remember to take pictures first, then eat the cake…

Did you know… You can copy the full file path from the final wizard page when exporting settings? – #247

Today’s tip is more like a “tip” than my usual “micro-functionality” daily tips.  After you do an export, the final page of the wizard shows you the full file path.  This is actually just a read-only edit box that has a tab stop (in other words, you can put your cursor in it and grab the full file path.)

Export Complete page

After you export your settings, you may want to open the file and see what’s there,  in case there are any tweaks you want to make.  Otherwise, you’ll have to open up the dialog and rewalk through the wizard to guess where you exported that file to…

Technorati Tags: VS2005Tip,VS2008Tip

Did you know… Visual Studio automatically saves all your current settings every time you close VS? – #246

On the Tools – Options – Environment – Import / Export Settings (yes, the Tools – Import / Export Dialog has its own Tools Options page), you’ll find the option where to store you current settings.  Note that you don’t get to opt out of this.  Prior to 2005, setting categories were saved in separate files in %appdata%, like a file for all your toolbox customizations, your window layouts, your keyboard shortcut bindings, your command bar changes, and so forth.  Starting in 2005, those settings are now stored in a centralized file, the .vssettings file.

Tools Options Environment Import Export Settings

Every time VS shuts down, we write out to this file location to keep your current settings current.

If you ever make a change that you need to quickly back out of, you can always go to Tools – Import / Export Settings – Import and choose the CurrentSettings.vssettings file located under the My Settings node/folder.  This maps directly to the file under Tools – Options – Environment – Import / Export Settings

My Settings folder in Import Settings

Technorati Tags: VS2005Tip,VS2008Tip

Did you know… You can save your current settings prior to doing an Import or Reset? – #245

Sometimes, Tip of the Day isn’t about stating the obvious; it’s about stating the non-obvious.  A lot of times, there’s functionality that seems trivial on the surface, but one-off things occur at a deeper level (like yesterday’s tip).  Fortunately, today’s tip is completely trivial.  no hidden operations going on under the UI.

Whenever you do a destructive operation via Tools – Import / Export Settings, like importing or resetting, we prompt you whether you want to save your current settings prior to continuing.  This is the exact same as doing a full export (meaning you go to  the Export page and check everything).

Save Current Settings page

The one thing i’ll call out is that the Store my settings file will remember any location where you’ve done an export to, since you may wish to save your current settings there too.

Technorati Tags: VS2005Tip,VS2008Tip

Did you know… What’s the difference between Resetting Settings and Importing Settings? – #244

Whenever I demo Tools – Import / Export Settings, I’m usually asked what’s the difference between the Import feature and the Reset feature.

From an end-user perspective, importing everything in that particular settings file is functionally the same as a reset.  That’s why we don’t show you the “Choose Settings To Import” wizard page.  If we did, you would see all the checkboxes checked and grayed-out on that page.

Full Import is same as a Reset

But of course, there’s more going on under the UI surface.  Whenever you do a Reset, Visual Studio records the file in the registry.  There are some shortcut within the IDE to quickly “reset” (and note how i use the term reset) those settings.

Below are the most common:

Tools – Options – Environment – Fonts and Colors – Use Defaults option

On the Fonts and Colors page, you’ll see the Use Defaults option.  This will reset your Fonts and Colors using the settings file you last reset to. 

Fonts and Colors options page Use Default button

Windows – Reset Window Layout

On the Windows menu, there’s the command Reset Window Layout.  This will reset your Window layout (i.e. all your tool windows in all 4 states) using the settings file you last reset to.

Windows menu Reset Window layout command

But…

What if you attempt to “reset” using a file you last reset to that didn’t contain this particular category.  For example, let’s say you last reset to your own reset file, and it didn’t contain the window layouts category.  Then I believe VS uses its “factory defaults” (the legacy settings that were built in for VS 2003 – the version before the import / export settings) when you do Windows – Reset Window Layouts.  I recall during one of the many “profiles” feature (import / export settings) design meetings the term “schizophrenia” being used to describe a possible state VS could end up in.  =D

Technorati Tags: VS2005Tip,VS2008Tip

Tip of the Day now available in Russian and Spanish

Thanks to Andy Gonzalez on the Globalization team for translating the tips into Spanish.

http://blogs.msdn.com/andygon/archive/tags/VS2008Tip/default.aspx

Thanks to Vitaly Zaiko on the Globalization team for translating the tips into Russian.

http://blogs.msdn.com/rusaraford/

I hope my humor and writing style weren’t too difficult to translate.  =)

Did you know… You can add your own files to the Import / Export Settings – Reset page list? – #243

If you go to the Reset page on the Tools – Import / Export Settings Wizard, you’ll see the list of files you can reset to.  These settings files are the ones created by the VS teams.  But, let’s say that one of the default files just has some small option that just annoys you (for me, i list this option below) or you want to add your own to the list.

Custom Files in the Reset Settings page

The RedRed.vssettings file is one i created.  I was testing tomorrow’s tip for fonts and colors.

These files live at \Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Profiles.  Remember, this feature was originally named profiles, where you would have a .vsprofile file, but i digress…  You’ll need admin rights to access Program Files, so please use at own risk.

In this folder you can add your own or modify the existing ones.  For me, I use the General Development Settings, but anytime I do a reset, I lose that show keyboard shortcuts in tooltips option.  So, I do a Reset to General Development Settings, I enable this one setting, then do a full export and call the file General Development Settings.  Then i can copy this file over the existing General Development Settings, and I won’t get frustrated the next time i do a reset and don’t see my shortcuts in my tooltips.

Technorati Tags: VS2005Tip,VS2008Tip

Did you know… You can bind macros to keyboard shortcuts (or how to quickly increase / decrease your text editor font size) – #242

This was tip #21, my final tip, for the TechEd VS 2008 IDE Tips and Tricks talk.

If you go to Tools – Options – Environment – Keyboard and in the Show Settings For edit box, type in “Macro”, you’ll see a list of “samples” right at the top.  I wrote the Accessibility macros, my 133 line contribution to the Visual Studio 2005 product, which you’ll also find in VS 2008.

There are two Accessibility macros worth noting, the Increase and Decrease Text Editor Font Size.

Accessibility macros in Tools Options Keyboard settings

If you are using the General Development Settings and do not want to cause any conflicts with other keyboard shortcuts, bind the Increase macro to Ctrl+Alt+Shift+Up arrow, and the Decrease macro to Ctrl+Alt+Shift+Down arrow.  of course you can bind them to whatever shortcut you want, but these will not have conflicts using general development settings.

Now open the editor and try out the keyboard shortcuts.  Remember that you have to hold down the “Ctrl+Alt+Shift” keys and hit the up or down arrow repeatedly to really experience the full effect.  Enjoy!

Technorati Tags: VS2005Tip,VS2008Tip

Did you know… You can use the immediate window as a glorified calculator or side-debugger within your debugger – #241

This was tip #20 in my TechEd VS 2008 IDE tips and tricks talk.

When you want to do more than just edit the value of a variable, you can rewrite entire functions or create new ones in the immeidate window.  I found this especially useful when I was doing the math to automate dragging a tool window from a docked location to  a docking target.  I basically had to do the math to calculate a straight line between the two points in order to send the coordinates to the mouse drag functions.  If i did the math wrong, i could pull up the immediate window and play with the calculations over and over again without interfering with the main debugger, meaning that the variables and state of the main debugger would remain the same unless i purposefully modified a value in the immediate window.

A very simple example:  let’s say that you have the basic “hello world” console app, but want to print out the result of some calculation.  Notice how the console app just has “hello world”

Hello World on Output Window

If i put a breakpoint at the very end of this simple console app, i can bring up the immediate window via Debug – Windows – Immediate and do whatever i need.  Let’s say i needed to use the immediate window as a glorified calculator, i can figure out the value of 1+1, as shown below in VB

immediate window calculating 1+1

Since we’re in a console application, you can even have the value of ‘i’ printed to the console window via the immediate window.  This is where you actually want to change the state of your debugger.

Writing 'i' to console window via immediate window

and now the value of 2 appears in the console window.

value of 'i' in console window

Technorati Tags: VS2005Tip,VS2008Tip