Monday, April 21, 2014

Tip 5.6: You can use F8 and Shift+F8 to navigate among errors in the Output window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



F8 and Shift+F8 are bound to the commands Edit.GoToNextLocation and Edit. GoToPreviousLocation. If you have the Error List open, F8 and Shift+F8 take you directly to the error in question by highlighting that part of the code. If you have the Output window open, F8 and Shift+F8 put the cursor on each error listed.



Happy Programming! =)
Posted by Nils-Holger at 11:26 AM with 694 comments.

Sunday, April 20, 2014

Tip 5.5: How to create a command alias

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



To create an alias, open the Command Window and type alias ha Help.About.



Now typing ha in the Command Window pops open the Help–About menu. But let's explore a more practical application. Consider creating the alias se for Solution Explorer, as shown here:

>alias se View.SolutionExplorer The idea for this example is that while you are coding in the editor, you can press Ctrl+/ to jump to the Find window and type se. Actually, you've probably already used one of the predefined aliases before. The command Debug.Print is alias to ?. To see the full list of aliases, type alias.



Finally, to reset your Command Window aliases back to defaults, type alias /reset.



Or you can simply use the /delete switch to delete a particular alias—for example, type alias se /delete to delete that se alias.

Happy Programming! =)
Posted by Nils-Holger at 11:47 AM with 443 comments.

Saturday, April 19, 2014

Tip 5.4: How to run external executables from the Command Window

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



The command Tools.Shell runs an external executable out of process from Visual Studio—for example, Shell .

But of course, there are optional arguments. Following are examples of optional arguments for the Tools.Shell command:

Shell [/commandwindow] [/dir:folder] [/outputwindow] [/args]
  • /commandwindow ( or /c) Use this command to display the executable's output in the Command Window.
  • /dir:folder Use this command to specify the working directory.
  • /outputwindow (or /o) Use this command to display the executable's output in the Output window.


For example, Shell /o xcopy.exe c:\users\nils-holger\documents\cmdwinlog.txt c:\users\nils-holger\logfiles displays the xcopy output in the Output window.



Happy Programming! =)
Posted by Nils-Holger at 12:22 PM with 429 comments.