Update: i’ve fixed the registry key for the recent files. ironically in my VS Tips talk today in Denmark, in the handout, i had a typo in the handout where I put "Recent" instead "Project" for the project MRU.

Have you ever deleted or renamed a project, only to accidentally try to reopen it through the Recent Projects menu or in the Start Page? Visual Studio is quick to point out to you that the project is unavailable via the following message box:

projects couldn't be loaded message box

Okay, that’s great, but why doesn’t VS then remove the project from the list, so you don’t keep accidentally selecting this project in the future? Instead VS moves it up to the top of the list, because it is the most recently visited project (because projects in an unavailable state still count.)

This is because Visual Studio is really tracking the project through the solution file. If the solution is valid, but the project is not, VS treats it as a recently visited project. However, if the solution does not exist, then VS asks you whether you want to remove it from the list:

solution couldn't be loaded

Getting back to today’s tip, how do you fix the first case, where the project doesn’t exist but the solution does?

Note: This involves modifying your registry settings. Only do so if you are comfortable and at your own risk.

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\ProjectMRUList

You’ll see the list of all the recently visited projects. Simply delete any one to have it removed from the list. This will remove it from the File –> Recent Projects and the Start Page Recent Projects. Note you will need to restart VS.

And the same “solution” (no pun intended) goes for Recent Files:

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\FileMRUList

Technorati Tags: VS2005Tip,VS2008Tip