Visual Studio .NET Tips & Tricks

Helpful information for Visual Studio .NET developers

Archive for the ‘Miscellaneous’ Category

Miscellaneous Items

Tip: VS.NET Add-ins

Posted by Ion Toma on April 17, 2006

VS.NET can be adapted and extended to automate the development process (like repetitive tasks) or to provide functionality that is missing (development tools, etc). The development environment can be extended using macros or add-ins. What is nice is that most of the add-ins are free to download and use.

Example: We can use GhostDoc, a free add-in for Visual Studio, to automatically generate XML documentation comments. GhostDoc is looking at the information in base classes or implemented interfaces. Also, it can generate the comments based on then ame and type of methods, properties or parameters. 

1. Before using GhostDoc
void checkLogin( string strUsername, string strPassword){

2. After installing GhostDoc, right-click on the method declaration and choose “Document this”. The following comments are generated:
/// <summary>
/// Checks the login.
/// </summary>
/// <param name="strUsername">The username.</param>
/// <param name="strPassword">The password.</param>
void checkLogin( string strUsername, string strPassword){

In this example, GhostDoc has automatically generated the documentation for our method based on the name of the method and the name of the parameters. Basically, it gives a starting point, we can easy add more information.

Note: a nice article can be found at, it is called "Visual Studio Add-Ins Every Developer Should Download Now"

Flash Demonstration


Posted in Add-ins/Plugins, Advanced, Miscellaneous, VS.NET 2003, VS.NET 2005 | 1 Comment »

Tip: Most useful shortcuts in VS.NET

Posted by Ion Toma on April 17, 2006

Switching between Windows:

Ctrl+F6  – navigate between various panes that appear in the base code editing window.
Shift+Alt+Enter – full-screen mode at any time. In full-screen mode, only the active window is visible in full screen.
Alt+F6/Alt +Shift+F6 – move cursor away from the main editing section into docked windows like Properties, Help, Dynamic help, Server Explorer (if these winows are open).
F7 – Jump to Code Behind/Base Code editing window

Ctrl+Shift+V   – cycle through the clipboard ring.
Ctrl+- (Ctrl + Hyphen) – similar with Internet Explorer, very easy to navigate from page to page.
Ctrl+Shift+- – cycles in the opposite direction.
Block Selection: – press Alt and then select the area you want with your mouse.
Line No in Code – Tools>Options>Text Editor>All Languages>General>Line numbers.
Ctrl+] :matching brace/comment/region/quote
F4: Property Window
Ctrl+Alt+L – Solution Explorer
Ctrl+Alt+O – Output Window
Ctrl+Alt+K – Task List
Ctrl+Shift+Space – intellisense window.
Ctrl+R – Word Wrap

Ctrl+K, Ctrl+K – Create/Remove Bookmark
Ctrl+K, Ctrl+N  – Move to next bookmark
Ctrl+K, Ctrl+P –  Move to previous bookmark
Ctrl+K, Ctrl+L – Clear all bookmarks

Code Format:
Ctrl+K, Ctrl+F – Auto-format selection
Ctrl+U – Convert to lower case
Ctrl+Shift+U – Convert to upper case
Ctrl+K, Ctrl+C – Comment selection
Ctrl+K, Ctrl+U – Uncomment selection

Code Outline:
Ctrl+M, Ctrl+M – Fold/Unfold the current code block
Ctrl+M, Ctrl+L – Unfold all
Ctrl+M, Ctrl+P – Stop outlining
Ctrl+M, Ctrl+O – Fold all

F5 – Start Application in debug Mode
Ctrl+F5 – Start Without debugging
F11 – Step into
F10 – Step over.
Shift + F11 – Step Out.
Shift + F5 – Stop debugging.
Ctrl+Shift+F5 – Restart Debugging.

Posted in Advanced, Beginner, Coding & Debugging, Intermediate, Miscellaneous, VS.NET 2003, VS.NET 2005 | Leave a Comment »

Tip: Treat Warnings as Errors

Posted by Ion Toma on April 16, 2006

A warning is a bug in waiting*. Warnings may be acceptable for debug builds, but for a release build, warnings must be always treated as errors. Zero-warnings should be as a rule for programmers, it is easy to ignore warnings, some of them may actually indicate a problem.
Warnings are the compiler's way of saying "this bit of code looks wrong, you better check it out“*. 

Others reasons:

  • It is bad practice to ship code that has compiler warnings in it. The compiler can help the developer, if the compiler generates an warning that means the developer must pay attention to it.
  • The customer may get some examples which contains sources. The warnings generated during compilation make the code look sloppy.

How to set it up: from Project Settings> Configuration Properties select the build setting and change the “treat warnings as errors” settings to true.Then set the warning levels to full, since we want to get all the help from the compiler as possible.

Warnings - Image 3


Posted in Coding & Debugging, Intermediate, Miscellaneous, VS.NET 2003, VS.NET 2005 | 2 Comments »