Remapping the Visual Studio F5 Key to Build Solution

Posted by: Clarity Blogs: ASP.NET, on 12 Nov 2009 | View original | NEW Bookmarked: 0 time(s)

Im writing this mostly as a resource for myself for the next time I need to remember how to do this, but hopefully someone else out there will find it useful.

Im currently working on a project where I am doing a lot of ASP.Net development.  For a couple of very good reasons the development team has decided to configure our development workstations to use the local IIS server that is built into Windows XP rather than working with the web server that is integrated into Visual Studio. Im starting to really like this workflow, particularly when Im doing a lot of jQuery or CSS tasks, because I dont need to wait for the whole project to recompile and launch in Visual Studios web server just to check a tiny change. 

One thing that I cant seem to get over is the entrenched reflex to mash the F5 key when I want to test a change.  I think its just too engrained in muscle memory as part of the test-fix-rebuild cycle Ive done a million times before.  After a couple of months of trying to shift my F5 habit toward using The Awkward Claw (Ctr+Shift+B), I decided to change the behavior in Visual Studio to simply trigger a build when I hit F5.  Heres what I did (Note: My team is kicking it old-school and using Visual Studio 2005.  You might need to do some translation to follow these steps in other versions of Visual Studio):

In Visual Studio open the Options dialog box (Tools > Options), expand the Environment group and click on the Keyboard node. In the Show command containing text box, type Debug.Start. Find the command named Debug.Start and select it.  Under the label that reads Shortcuts for selected command: click the Remove button to unwire the F5 shortcut key.

Visual Studio Options dialog box

Now all those inadvertent presses of F5 wont do anything.  This is marked improvement, but we can do better. We can harness all of those uncontrollable left-middle finger reaches to recompile our solution, which is what I want to do 95% of the time anyway.

To wire the F5 shortcut key to the build operation we can use the same section of the Options dialog box.  This time we are going to filter the available commands by typing Build.BuildSolution into the text box. Find the command named Build.BuildSolution and select it. Now in the drop down list under the label that reads Use new shortcut in: select Global. Put focus in the textbox under the label that reads Press shortcut keys: and press the F5 key and then click the Assign button.  The build solution action is now wired up the F5 key.

Visual Studio options dialog box

Advertisement
Category: Visual Studio | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 351 | Hits: 9

Similar Posts

  • Facebook Developer Toolkit 3.0 ASP.NET MVC Sample more
  • Experimenting with MongoDB from C# more
  • "ADO.NET Entity data model" or "edmx" or "L2E" debug visualizer more
  • My ASP.NET MVC stack and why I chosen it more
  • Debugger Visualizers not working in ASP.NET Medium Trust more
  • Why VBA Still Makes Sense more
  • Sneak Peek: ASP.NET Time Edit Control more
  • Telerik and Imaginet Resources Introduce Free Developer Team Management Tools Built with RadControls for WPF more
  • Searching and Navigating Code in VS 2010 (VS 2010 and .NET 4.0 Series) more
  • Compiling pixel shaders for Silverlight more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD