none
Clear MRU list in Visual Studio 2017

    Question

  • I know it was undocumented, but I used to use the registry in Visual Studio 2015 and earlier to clear my MRU lists and reset all the dialog paths to my happy locations :-)

    e.g.

    reg add HKCU\Software\Microsoft\VisualStudio\14.0 /v DefaultFileOpenLocation /t REG_SZ /d "C:\VS" /f
    reg add HKCU\Software\Microsoft\VisualStudio\14.0 /v DefaultNewProjectLocation /t REG_SZ /d "C:\VS" /f
    reg add HKCU\Software\Microsoft\VisualStudio\14.0 /v DefaultNewProjItemLocation /t REG_SZ /d "C:\VS" /f
    reg add HKCU\Software\Microsoft\VisualStudio\14.0 /v DefaultOpenProjectLocation /t REG_SZ /d "C:\VS" /f
    reg add HKCU\Software\Microsoft\VisualStudio\14.0 /v DefaultOpenProjItemLocation /t REG_SZ /d "C:\VS" /f
    reg add HKCU\Software\Microsoft\VisualStudio\14.0 /v DefaultOpenSolutionLocation /t REG_SZ /d "C:\VS" /f
    reg add HKCU\Software\Microsoft\VisualStudio\14.0 /v VisualStudioProjectsLocation /t REG_SZ /d "C:\VS" /f
    reg add HKCU\Software\Microsoft\VisualStudio\14.0\NewProjectDialog /v LastUsedNewProjectPath /t REG_SZ /d "C:\VS" /f

    I cannot find equivalent location for Visual Studio - my HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\15.0 is quite barren, and I cannot find the information under AppData\Local or AppData\Roaming by using Findstr.

    i.e., I created ConsoleApp1 and cant find the text file where this stuff is stashed so I can clear it.

    Anybody know what to do?

    Thanks!

    Friday, March 10, 2017 6:15 PM

Answers

  • Hi,

    The increase the isolation and resilience of VS 2017, it uses now a private registry hive. Internally VS uses a redirection and while for VS extensions (which are dlls) this is transparent, for external processes (that are exes), this causes them not to work.

    To change values in the private registry hive by hand, you can use regedit.exe to load a private hive. You need to select the HKEY_USERS node, and click the File > Load Hive… menu. You select the privateregistry.bin file, give a name to the hive (I entered “VS2017PrivateRegistry”) and now you can see the 15.0<id>_Config key populated as usual (note: use File > Unload Hive when done):

    To change values in the private registry hive programmatically you need either to build an extension for VS or if you want to use an external exe you need to use the RegLoadAppKey function or avoid using the registry directly and use the External Settings Manager. See the section “Change: Reduce registry impact” in Breaking Changes in Visual Studio 2017 extensibility.


    My portal and blog about VSX: http://www.visualstudioextensibility.com<br/> Twitter: https://twitter.com/VSExtensibility<br/> MZ-Tools productivity extension for Visual Studio: https://www.mztools.com


    Sunday, March 12, 2017 6:40 AM

All replies

  • It looks like this stuff is stashed in privateregistry.bin under AppData\Local\Microsoft\VisualStudio\15.0_4fe699e7.

    Am I missing something really easy and obvious in the app to clear this stuff.

    Thanks.

    Friday, March 10, 2017 7:12 PM
  • Hi,

    The increase the isolation and resilience of VS 2017, it uses now a private registry hive. Internally VS uses a redirection and while for VS extensions (which are dlls) this is transparent, for external processes (that are exes), this causes them not to work.

    To change values in the private registry hive by hand, you can use regedit.exe to load a private hive. You need to select the HKEY_USERS node, and click the File > Load Hive… menu. You select the privateregistry.bin file, give a name to the hive (I entered “VS2017PrivateRegistry”) and now you can see the 15.0<id>_Config key populated as usual (note: use File > Unload Hive when done):

    To change values in the private registry hive programmatically you need either to build an extension for VS or if you want to use an external exe you need to use the RegLoadAppKey function or avoid using the registry directly and use the External Settings Manager. See the section “Change: Reduce registry impact” in Breaking Changes in Visual Studio 2017 extensibility.


    My portal and blog about VSX: http://www.visualstudioextensibility.com<br/> Twitter: https://twitter.com/VSExtensibility<br/> MZ-Tools productivity extension for Visual Studio: https://www.mztools.com


    Sunday, March 12, 2017 6:40 AM
  • Hi tballard,

    Welcome to the MSDN forum.

    What's your VS 2017 version? I confirmed this folder AppData\Local\Microsoft\VisualStudio\15.0_4fe699e7 on my side, there is no such folder that have some folders with the similar name and there has the file privateregistry.bin like your description.

    Do you want to clear the recent projects that display on the Start page through delete the corresponding registry key? For VS 2015, we can remove the following, but for VS 2017, this method cannot work. You can temporarily remove it from the Start page by right click the project name and choose 'Remove From list'.

    Recent Projects
    HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\14.0\MRUItems\{a9c4a31f-f9cb-47a9-abc0-49ce82d0b3ac}\Items

    Recent Files
    HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\14.0\MRUItems\{01235aad-8f1b-429f-9d02-61a0101ea275}\Items

    Best regards,

    Sara


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by tballard Thursday, March 16, 2017 3:48 PM
    • Unmarked as answer by tballard Tuesday, September 5, 2017 2:37 PM
    Monday, March 13, 2017 8:00 AM
    Moderator
  • Thanks a lot for the great answer. I think I may find what I am looking for perhaps by perusing the source code of https://github.com/Microsoft/vswhere, it seems to have magic powers.

    For today I will use your solution :)

    Thursday, March 16, 2017 3:49 PM
  • Carlos, thank you so much!!!  This is the kind of answer I was looking for.  Undocumented sure but I'll take my chances.
    Tuesday, September 5, 2017 2:38 PM
  • Sara

    IT DOES NOT WORK.  I have my mru set to 24.  It is stuck on 10 without any way to remove them

    I DON'T USE THE START PAGE, it is unnecessary fluff that MS added

    Thank you but that is another wrong answer

    Thursday, September 7, 2017 9:06 PM