Showing posts with label visual studio. Show all posts
Showing posts with label visual studio. Show all posts

Tuesday, 11 August 2009

Visual Studio Tricks

I am going to keep this as an ongoing post with whatever tips and tricks I come across when using Visual Studio.

Show Active File In Solution Explorer

When working with big solutions and projects this is so useful. By default visual studio doesn't highlight the file that is active (i.e the one you are viewing) in Solution Explorer.

To activate this do the following:

Tools – Options – Projects and Solutions – Track Active Item in Solution Explorer

Credit for this tip goes to Ronald Widha's blog .

Use the Command Window to Search for Files

In Visual Studio I really miss the equivalent of Eclipse's CTRL - T shortcut to search for classes.

The next best thing I have found is to open the command window ( View > Other Windows > Command Window ) and type:

>open file you're searching for

and a little drop down will pop up of files that start with whatever you have typed in.

More Tricks

Also check out any of my blog entries tagged with visual studio











Wednesday, 4 March 2009

Adding ClearCase commands to Visual Studio context menu

If you are using Visual Studio and clearcase this is really useful. This puts clearcase functions like opening the version tree into the menu when you right click on a file in solution explorer.

1. The following link shows you how to add new menu items to the context menu when you select file in the solution explorer:

http://www.sharpregion.com/blog/?p=105&cpage=1

2 . Just add the following bit of code to the module ContextCommads or download the full file from here:




3. Now Repeat steps 7 to 9 from the afore mentioned link Extending the Visual-Studio Context-Menu for the following three subs :

VersionTree - this opens up the clearcase version tree for the selected file
HijackFileCommand - hjacks the selected file (makes it writeable)
ClearCaseAnnotateCommand - calls the clearcase annotate command to show who and when each change was made on the selected file

Thats it. Now right click on a file and you will have these options available

Tuesday, 6 January 2009

Remote Debugging a .NET app with Visual Studio 2008 (9)

This is where you need to debug an application in visual studio, but the process is running on some other machine (i.e. not on your local box). A good example is when a tester is running something and you want to connect to their box to debug it.

This in fact turned out to be a pretty painless process.

First on the machine where the app is running that you need to debug you need to run msvsmon.exe . I found this in

Program Files
\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86 .

This will bring up the "Visual Studio Remote Debugging Monitor".

More than likely you will be debugging a machine on your network. So goto Tools>Permissions, and add the user of the machine where visual studio is running.

Now run the application you intened to debug

Now in Visual Studio goto Debug>Attach to Process . In the box "Qualifier" , enter the machine name of where your application is running and hit enter.

A list of processes will appear in the "Available Processes" box below. On the other machine in the remote debugging monitor you will see a log that you have connected.

Select the process which corresponds to the app you want to debug from Available processes and click on attach. And that's it you are now in debug mode and you can set your breakpoints and whatever and debug your app in the usual way!

For more info look at this article from microsoft :

http://support.microsoft.com/kb/910448