Welcome to MSDN Blogs Sign in | Join | Help

Rahul Soni's blog

Never assume the obvious is true!

News



  • These postings are provided "AS IS" with no warranties, and confers no rights.
Visual Studio 2008 - More control over Recent Projects list in Start Page

If you work with a lot of samples, the chances are quite likely that you will end up in a rather dirty list of Recent Projects List in Visual Studio. I'm personally quite nit-picky and I really hate it when I find something like this...

image

Now... I don't know which of these Samples should I click on (since I have two in the list!). Anyway, there are multiple reasons why you would like to remove the junk entries from this list. One way is to open the Registry and navigate to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\ProjectMRUList. This list contains all the values you are looking for. Delete the values which you don't like and restart Visual Studio.

Another way, which I think is a smarter one is to download this ZIP and do the following...

1. Extract it anywhere in your machine.
2. Open Visual Studio, click on Tools -> External Tools...
3. Click on Add button and in the Title field, write "Clear Recently Used List"
4. In the Command Line, browse to the <SAVED__PATH>\ClearRecentItems.exe and click on OK.

image
4. Now, you should have this tool listed on your Tools Menu in VS 2008.

image

5. Here is the sample output...

image

Feel free to download the code for this small utility...

Download 

Hope this helps, Wave
Rahul

Posted: Tuesday, June 17, 2008 10:57 AM by rahulso

Comments

kjopc said:

It would be better if Visual Studio had a built-in tool where developers could manage the Start page. For example, it should allow selective removal of projects by right-clicking on the project name.

# June 17, 2008 10:22 AM

SvenC said:

Nice tool - but it is Visual Studio 9 aka Visual Studio 2008 ;-)

--

SvenC

# June 17, 2008 10:25 AM

rahulso said:

Kjopc,

I agree with you, totally! If you feel strongly about it, feel free to give feedback at http://connect.microsoft.com/VisualStudio/Feedback

SvenC,

Thanks for pointing out :-) My bad, just corrected it.

Cheers,

Rahul

# June 17, 2008 11:59 AM

gOODiDEA said:

.NETOpenCSV#Explorer-AVisualStudio2005add-inwhichinteractswithWindowsExplorerVisual...

# June 17, 2008 8:04 PM

gOODiDEA.NET said:

.NET OpenCSV# Explorer - A Visual Studio 2005 add-in which interacts with Windows Explorer Visual Studio

# June 17, 2008 8:07 PM

songstre said:

Nice tool. Too bad it doesn't refresh the Recent Projects list after deletion.

# July 10, 2008 10:47 AM

rahulso said:

Hi Songstre,

Thanks for your comments!

AFAIK, this can't be done from this tool simply because VS loads it from the registry while starting up. If I come to know of any API / Method which induces that call, I will update this tool.

Rahul

# July 10, 2008 11:15 AM

OmegaMan said:

Just don't run the tool on a fresh install of VS2008! It cores (object reference set to null...) because there is no list!

# August 8, 2008 10:49 AM

Doug Urquhart-Mitchell said:

Rahul,

A great tool - any chance you can modify it to work with VB Express 2008?

Doug.

# September 12, 2008 12:51 PM

rahulso said:

Doug Urquhart-Mitchell,

Thanks.

Stay tuned on www.dotnetscraps.com. I will post it once it is done. Can you mail me the registry key for Express edition. Instead of making it hardcoded, I will make it configurable.

It should be something like...

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\ProjectMRUList

Thanks,

Rahul

Mail me at rahulso@microsoft.com, and I will get it done whenever I get an opportunity.

# September 13, 2008 3:24 AM

JM Hernandez said:

"Feel free to download the code for this small utility..."

Really, I do not know how to download the code...

# October 15, 2008 9:40 AM

rahulso said:

Sorry about that as well as the late response JM!

I removed the code by mistake. Right now, I don't have access to the FTP. If it is urgent, mail me and I will give a copy through email.

Thanks,

Rahul

# October 20, 2008 10:30 AM

David said:

Why don't you just post the code on Code Plex?

# January 7, 2009 4:12 PM

Alan A said:

FYI: Used the ClearRecentList tool on VS 2008 Web Developer Express and got this exception:

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.NullReferenceException: Object reference not set to an instance of an object.

  at ClearRecentItems.frmClearList.LoadItems()

  at ClearRecentItems.frmClearList.frmClearList_Load(Object sender, EventArgs e)

  at System.EventHandler.Invoke(Object sender, EventArgs e)

  at System.Windows.Forms.Form.OnLoad(EventArgs e)

  at System.Windows.Forms.Form.OnCreateControl()

  at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

  at System.Windows.Forms.Control.CreateControl()

  at System.Windows.Forms.Control.WmShowWindow(Message& m)

  at System.Windows.Forms.Control.WndProc(Message& m)

  at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

  at System.Windows.Forms.ContainerControl.WndProc(Message& m)

  at System.Windows.Forms.Form.WmShowWindow(Message& m)

  at System.Windows.Forms.Form.WndProc(Message& m)

  at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

  at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

  at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

----------------

I'm clearing the registry list to clear the recently used:  [HKEY_CURRENT_USER\Software\Microsoft\VWDExpress\9.0\ProjectMRUList]

# March 22, 2009 11:33 AM

Raymond Lucki said:

Here's source code for a similar, simplified (less elegant, but perfectly functional) utility that will clear the entire recent projects list with one button click.  To use this source code, in Visual Studio, create a new Windows Form project (VB), rename the form to "MainForm", adjust the form size and caption as you like, add a single button and name it "ClearBtn".  Add the line "Imports Microsoft.Win32" to the top of your form's code module (needed for registry access functions).  Create an event handler for the button's CLICK event, and update the click event handler's code to match what is shown below.  

If you want to convert this to work with a different MS Visual Studio version or related Microsoft IDE, I would recommend doing a little research to find the registry subkey that said IDE uses and replace the registry string reference in the source code below with the corrected subkey (regKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\VisualStudio\9.0\ProjectMRUList", True))

Like the earlier tool, this can be added as an external tool into Visual Studio, but it doesn't refresh the list that's already displayed, which is only requeried by Visual Studio when it's relaunched.  Maybe there's a way to do that.. you could also modify this application to clear the recent project list and then have it launch Visual Studio for you as a sort of "pre-loader" instead of using it as a tool from within Visual Studio, if you are really fastidious about keeping that list cleared.  I like to clear this list so I can make tutorial videos and not have a cluttered screen that references projects unrelated to the tutorial.

Entire source code:

'--FORM SOURCE BEGINS-------------------------------

Imports Microsoft.Win32

Public Class MainForm

   Private Sub ClearBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearBtn.Click

       Dim regKey As RegistryKey

       Dim str As String(), i As Integer, removed As Integer

       removed = 0

       Try

           regKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\VisualStudio\9.0\ProjectMRUList", True)

           str = regKey.GetValueNames()

           If str.GetLength(0) > 0 Then

               For i = 0 To str.GetUpperBound(0)

                   If str.GetValue(i).ToString().Contains("File") Then

                       regKey.DeleteValue(str.GetValue(i).ToString())

                       removed = removed + 1

                   End If

               Next

           End If

           regKey.Close()

       Catch ex As Exception

           ' Most likely cause of an exception is that the registry key/subkey specified does not exist

           MessageBox.Show(ex.Message())

       End Try

       If removed > 0 Then

           MessageBox.Show("Changes will be visible the next time Visual Studio 2008 is launched.", _

                           "Info", MessageBoxButtons.OK, MessageBoxIcon.Information)

       Else

           MessageBox.Show("Nothing to do.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information)

       End If

       Application.Exit()

   End Sub

End Class

'--FORM SOURCE ENDS---------------------------------

# June 5, 2009 2:59 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker