Visual Studio 2005 Profiles and a Few Tweaks I like to Make
 
Published: 21 Oct 2005
Unedited - Community Contributed
Abstract
In this article, Scott demonstrates how to work with Profiles using Visual Studio 2005. He also provides explanation about how to tweak VS2005 to reap maximum benefits.
by Scott Guthrie
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 17407/ 24

Introduction

Republished With Permission - Original Article

One of the new features in VS 2005 is the support for "profiles" in the IDE.  Profiles provide the ability to define pre-set defaults for options, menus, key-bindings, and command-bars across the tool-set.  VS 2005 ships with several built-in profiles out of the box including: VB, C#, C++, Web, Test, and a General Development Settings similar to 2003.  When VS launches the very first time it prompts a user to pick which of these profiles to use by default (note that you can build all app types and even use all languages regardless of which profile you pick).

If you ever want to change or reset your profile, you can select the Tools->Import and Export Settings menu option.  It will then walk-you through a wizard where you can export or import settings to/from others (these are saved as XML files that you can ship around to work colleagues or friends).  If you select the "reset all settings" radio button in this dialog, it will let you nuke and re-pick your default profile from scratch (for example: to re-pick the C#, VB or Web one by default).

There is bound to be lots of debate as to which profile is best, and why different options are set differently in whichever profile.  The good news is that once you pick a profile, you can tweak it however you want to make it "perfect" (where perfect = what you personally think is right).

I’ve seen a few common questions on forums about profile tweaks (how do I make it do xyz) that I thought I’d call out in case you were interested:

Some Common Profile Tweaks and Optimizations

Enable the output window to show up on build 

By default, the C# profile doesn’t show the build output window when you start a build (instead you need to manually show it).  I personally like to see the build output window always show up so that I can better track progress (note in Web Projects it will now list each directory as it builds them – so you can quickly see which directories are getting re-built when dependencies change). 

To enable this by default, select the Tools->Options menu item.  Then under Project and Solutions->General select the "Show Output Windows when Build starts" checkbox.

Note that this option is enabled by default with the web profile.

Show MSBuild Output Verbosity "Normal"

By default, the C# and Web profiles send only "minimal" MSBuild information to the output window.  You can configure additional levels of output information by selecting the Tools->Options menu item.  Then under Project and Solutions->Build and Run you can select the MSBuild project verbosity dropdown to be: "Quiet", "Minimal", "Normal", "Detailed", and "Diagnostic". 

I personally like "Normal", since it gives me build times for projects, and is also explicit about when/where files outputs are updated and to where. This is very useful when you have pre/post actions and are trying to track down when they are firing and what impact they are having.

Here are two samples showing the output window differences between the two settings:

Minimal Output

------ Build started: Project: ClassLibrary1,Configuration: Debug Any CPU ------
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE
/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll
/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll
/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /debug+
/debug:full /optimize- /out:obj\Debug\ClassLibrary1.dll /target:library
Class1.cs Properties\AssemblyInfo.cs
Compile complete -- 0 errors, 0 warnings
ClassLibrary1 -> C:\Documents and Settings\Scott\My Documents\Visual Studio
2005\Projects\webtest\ClassLibrary1\bin\Debug\ClassLibrary1.dll

Normal Output

------ Build started: Project: ClassLibrary1,Configuration: Debug Any CPU ------
Build started 10/20/2005 9:24:41 PM.
Target CoreCompile:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig 
/nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE
/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll
/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll
/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /debug+
/debug:full /optimize- /out:obj\Debug\ClassLibrary1.dll /target:library
Class1.cs Properties\AssemblyInfo.cs
Compile complete -- 0 errors, 0 warnings
Target CopyFilesToOutputDirectory:
    Copying file from"obj\Debug\ClassLibrary1.dll" to"bin\Debug\ClassLibrary1.dll".
    ClassLibrary1 -> C:\Documents and Settings\Scott\My Documents\Visual Studio
 2005\Projects\webtest\ClassLibrary1\bin\Debug\ClassLibrary1.dll
    Copying file from"obj\Debug\ClassLibrary1.pdb" to"bin\Debug\ClassLibrary1.pdb".
Build succeeded.
Time Elapsed 00:00:00.21

The difference is subtle between these two settings, but I think very useful.  Notice how with the minimal output you can’t tell whether the assembly was updated (note that it won’t be updated if no changes were made to the project), whereas with normal output it is clearly called out.  Normal output also shows build-times per project.

Track Active Item in Solution Explorer

One feature that was on by default with VS 2003 that a lot of people find useful was the ability to see the current document icon highlighted in the solution explorer as you moved around from document to document (it will also scroll the solution explorer so that the document is in view).  This can be useful when you have deeply nested content in sub-folders and want to see the current document’s relation to others. 

By default, the C# profile has this disabled, while the Web profile has this on.

To enable this feature in the C# profile, select the Tools->Options menu.  Under Projects and Solutions->General select the "Track Active Item in Solution Explorer" checkbox.

Build Configuration Manager Dropdown in Toolbar

VS supports the concept of build configurations.  For example: you can configure different settings for “debug” and “release” configurations (which projects build, etc) – as well as define your own (for example: staging, test, deployment, etc).  Note that the new Web Deployment Project solution my team is shipping in a few weeks will let you do some really cool things with this and VS 2005 web projects (including the ability to dynamically replace configuration settings like connection-strings as part of which build configuration you pick).

You can configure which configuration in VS is the "active" one by selecting the Build->Configuration Manager menu item.  This will bring up a modal Configuration Manager dialog with a drop-down to let you pick the active one.  With the C# profile applied, you can also select the current configuration via a configuration drop-down located in the standard toolbar (this makes switching really fast – and was there by default with VS 2003).  This drop-down is not present in the VB or Web profile by default.

To enable it in the VB or Web profile, select the Tools->Customize menu item. Click on the Commands tab in the dialog that comes up.  Select the "Build" item in the Categories list box, and then scroll down to the very bottom of the Command list-box where you’ll fine the "Solution Configurations" list item.  To add it into one of the IDE toolbars, you need to click it and then drag and drop it to the toolbar in the IDE location you want to add it to.

Note: This completely fails the "intuitive and discoverable sniff test" – but was actually the same behavior in past versions of VS.

Hope these suggestions help.  As you’ll discover as you start to wade through the options dialog, there are literally thousands of tweaks you can make.

Resources



User Comments

Title: Thanks   
Name: Hugo A.
Date: 2008-10-15 11:51:38 AM
Comment:
This is a usefull article. I wanna know how to personalize each perfil. For example Crtl+x = Close all windows.

Thanks again.
Title: missing search   
Name: vs2005 ide toolbar question
Date: 2007-04-11 10:51:42 AM
Comment:
in vs2005, i don't see the search text area in the tool bar. beside it was a dropdown(search solution, project etc).
How do i get it restored?
Thanks,Peter
Title: Very usefull article   
Name: Harm Neervens
Date: 2007-04-03 1:33:11 AM
Comment:
Hi Scott,

This document was very helpfull. Some of these (hidden feateres) I would have been searching for days...
Title: Solution Configurations   
Name: Jyothi Sankuri
Date: 2006-08-23 4:11:55 PM
Comment:
hey I could add the Solution Configurations but its inactive to change, could you please tell me how to make it active and change the configuration to the debug mode.
jsankuri@yahoo.com
Thanks & Regards,
Jyothi Sankuri

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-19 2:38:23 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search