Web Technologist
Posts tagged visual studio
Organize Usings
Aug 23rd
During your development, you may notice that your code file contains using directives which are not required by your code. The Visual Studio IDE provides the Organize Usings option to remove/sort these using directives. To access this option, right-click anywhere within your code editor and select one of the sub-menu options for Organize Usings option.
- Remove Unused Usings : This option will remove any using directive not required by your code. Note : Please build your application before executing this option to ensure that any required directives are not removed.
- Sort Usings : This option will organize your Using directives alphabetically giving precedence to the System name-space.
- Remove and Sort : Use this option to execute the above operations together.

Javascript Formatting
Jul 15th
Like most developer I love jQuery and appreciate the intellisense support in Visual Studio. I am very particular about the format for my code and often use the Document Format option of the IDE. What I noticed was that my braces were never placed on new lines, and I wanted to change this. So here’s what you can do :
- In the Tools menu, select Options…
- Check the Show all settings options
- In the Text Editor > JScript choose the Formatting option.
- On the right pane, there are two options under the ‘New lines’ section. Check them as per your requirement.

Conditional Breakpoints
Dec 23rd
Visual Studio is filled with nifty tricks, which if leveraged properly in the right situation can make the developers life easy. Consider if you had a looping statement, and wanted to debug it, but only for a particular value. Rather than hitting the breakpoint every time, you can shorten the hits by using a Conditional Breakpoint.
To set a Conditional Breakpoint, right-click the Breakpoint circle and select the Condition option.

You can then define the condition and additionally select an option to filter the condition for evaluating the condition, or for raising the breakpoint when the value of the expression changes.
Attach to Process…
Dec 22nd
The average programmer uses the general Debug mode by using the “Start Debugging” option from the Debug menu, or the F5 shortcut key. But what if you want to debug an application that is already running? If you faced this problem, then this tip should lighten up your day.
Choose Debug | Attach to Process….
Select the aspnet_wp.exe from the list of Available Processes and click on Attach

Alternatively you can also use ALT + D , P to select the option.
Remove project from Recent Projects in Visual Studio
Sep 15th
Recently, I felt the need for removing a project from the Visual Studio Start Page, so I Googled and would like to share the solution. Don’t forget to close visual studio before trying this out. This trick requires modification to registry, so if you are skeptical do make a backup of the registry before proceeding.
Start the registry :
Start > Run > regedit > HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\ProjectMRUList
Then delete the key that has the project you want to remove.

Note:
- The Project Keys are consecutive. So if you have 5 projects listed, and you delete the key for the 4th project ie File4, the 5th project (File5) will also not be shown. You will need to remain one of the keys so that the list remains consecutive.
- The same procedure can be repeated for the FileList and Find sections of the registry




