Monday, April 15, 2019

Where is the Template MRU in VS 2109?

In the latest version of Visual Studio, there is a new bug called the Start Window. It is a modal dialog, which is a bad thing, but not the subject of this post. This post is about the list of most recently used templates. If you want to try out some of the new things this release offers, you make projects you would never make otherwise. All these templates get added to the MRU list, thus obscuring the templates you normally use day in and day out. And guess what. There is no way to remove them. There is no right-click option to "remove from this list."

So I wondered where VS keeps this list. I remember from several years ago that the MRU files were kept in the registry. So I looked in the registry.

The registry for VS 2019 (v16.0) is almost empty. Whereas, earlier versions had a full 1.5 tons of stuff, there is almost nothing in the registry anymore. So after poking arount on the Internet for a while, I came up with this procedure for finding that list. It is not nearly as easy to edit this list as it was to edit the older ones. But anyway, here is what I did:

Close all instances of Visual Studio

Open Regedit

Select HKEY_USERS

Select File -> Load Hive...

Navigate to this file and select it:

"C:\Users\weblum\AppData\Local\Microsoft\VisualStudio\- 16.0_d9ee1292\privateregistry.bin"

or its equivalent on your machine.

Name it something. E.g., VS2019Private

It appears in the Regedit window. Navigate to this key

HKEY_USERS\VS2019Private\Software\Microsoft\VisualStudio\- 16.0_d9ee1292\ApplicationPrivateSettings\VS\IDE\Platform

This key has one value named ProjectTemplateMru. Its data is a REG_SZ containing a JSON object like this:

1[{...}, {...}, {...}]

The objects in that array are the entries. I don't know what the leading "1" is.

While you have this hive mounted, you cannot use Visual Studio. Select the key you added, (e.g., VS2019Private) and select File -> Unload Hive...

Reopen any Visual Studio instances you want.

0 Comments:

Post a Comment

<< Home