How to get visual studio 2010 icons for files in Visual Studio 2012 Solution Browser

I got access to Visual Studio 2012 a couple of days ago, and I found that the solution explorer is a little too minimal for my taste. With most gray and black icons, I have to make an extra effort to find out the file I was looking for.

Is there any way to get back to 2010 style icons for files?

+5
source share
2 answers

The only "solution" I know is to uninstall Visual Studio 2012.

, . 2012 , HKEY_CLASSES_ROOT 2012 . "" . , .csproj C:\Program Files (x86)\Microsoft Visual Studio 11.0\V#\VCSPackages\csproj.dll. , C:\Program Files (x86)\Microsoft Visual Studio 10.0\V#\VCSPackages\csproj.dll. .reg , :

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\VisualStudio.Launcher.csproj.11.0\DefaultIcon]
@="c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC#\\VCSPackages\\csproj.dll,0

"icon" 2010 . , "".

:

, , 11.0 , 10.0 . :

const string vsDirectory = "c:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\";
int index = vsDirectory.IndexOf("10.0\\", StringComparison.Ordinal);

var keyNames = Registry.ClassesRoot.GetSubKeyNames();
foreach (var name in keyNames.Where(name => name.StartsWith("VisualStudio.Launcher.")))
{
    using(RegistryKey key = Registry.ClassesRoot.OpenSubKey(name+@"\DefaultIcon"))
    {
        if (key == null) continue;
        var value = key.GetValue(null).ToString();
        if (!value.StartsWith(vsDirectory)) continue;
        var sb = new StringBuilder(value);
        var newValue = sb.Replace("10.0", "11.0", index, 4).ToString();
        var elements = newValue.Split(',');
        if (elements.Length <= 0) continue;
        var filename = elements[0];
        if (File.Exists(filename))
        {
            key.SetValue(null, sb.ToString());
        }
    }
}

, VisualStudio.Launcher, , "c:\Program Files (x86)\Microsoft Visual Studio 11.0 \" 10.0. .cs. , "VisualStudio.Launcher." "VisualStudio.". , 10 11.

10 11 , SetValue . , , "c:\Program Files (x86)".

. . , , .

+5
const string vsDirectory = "c:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\";
int index = vsDirectory.IndexOf("10.0\\", StringComparison.Ordinal);

index -1, "c:\Program Files (x86)\Microsoft Visual Studio 11.0 \" "10.0 \"

.. , , , , , , , , . . , -,

-1

All Articles