Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
639 views
in Technique[技术] by (71.8m points)

visual studio 2017 - How to edit (customize) Color Themes in VS2017 Preview

has anyone figures out, how to change the color theme in VS2017.

I used a custom Theme in 2012 and later in 2013. I imported it with the Extension. But I was also able to Import the theme via registry to the Express Versions, where the Extension wasn't running.

In 2017 there is no Extenesion (yet!? - I hope it is coming, I can't stand that blue or black or White), and I didn't found the place in the registry.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The actual extension is now live for VS 2017. – vaindil

The official Visual Studio 2017 Color Theme Editor has arrived! I recommend using it instead of the hack below. Since the hacked version has some downsides that the official plugin does not have: it requires restarting visual studio when importing themes, plugin updates cause loosing themes, it doesn't define all colors that VS2017 uses.

Still, people might find use in hacking VSIX-files to get old Visual Studio plugins working. Therefore I leave the original answer below for reference.

Original answer: hacking plugin VSIX-file

With some hacking you CAN install the VS2015 Color Theme Editor or the VS2013 Color Theme Editor. I tried it and it more or less appears to work*.

  • download the linked VSIX-file and save it somewhere (e.g. in ColorThemeEditor.vsix);
  • VSIX-files are zip archives, open its contents for editing (or extract it and recompress it after editing) (for example with 7-Zip);
  • Edit extension.vsixmanifest;

    • there are two InstallationTargets (Id="Microsoft.VisualStudio.Pro" and Id="Microsoft.VisualStudion.IntegratedShell");
    • change the Version from "[14.0,15.0)" or "[12.0,13.0)" to respectively "[14.0,16.0)" or "[12.0,16.0)"
    • Only for the VS2013 Color Theme Editor, remove the Dependency with DisplayName="Visual Studio Product Updates" or change it to Version="12.0.20827.3,16.0))

      Visual studio 2017 is version 15.0. Square bracket means inclusive, whereas round bracket is exclusive.

  • Save extension.vsixmanifest and ColorThemeEditor.vsix;
  • Open ColorThemeEditor.vsix via the VSIXInstaller

    There might be some warnings about incompatible versions; but if all went well `Visual Studio 2017 is among the versions in which the plugin can be installed.

  • Install the plugin for Visual Studio 2017.

Editing and saving themes is problematic, as pointed out by @RepoMan. The following work around allows you to edit a theme and save it:

  • Edit the theme as you normally would
  • Save the changes, e.g. via the save and apply button
  • Visual Studio throws a null reference exception; ignore it.
  • Visual studio is not yet affected by the changes
  • Restart Visual Studio; the new instance should have your theme changes.

*There is a problem when importing and deleting imported themes: Could not load file or assembly 'Microsoft.VisualStudio.ExtensionManager, Version=12.0.0.0. .... At first the imported theme can not be selected. After visual studio has been restarted you can select the imported theme.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...