/ Theme

Convert old .vstheme file from Visual Studio 2019 to Visual Studio 2022 (VSIX-Theme)

Hi. Today I tried the new version of Visual Studio and I immediately realized, that the old "Visual Studio Color Theme Editor" is not available. So how do I get my hard changed theme to VS 2022? This post will show you how you can convert your old .vstheme file to a new VSIX-Theme-Extension.

  1. You need the then nuget package "Microsoft.VisualStudio.VsixColorCompiler". This nuget contains the VSixColorCompiler.exe which converts your .vstheme file to a .pkgdef file. With this file, we will build the VSIX to import your Theme into VS 2022.

    • create a new console or class project in VS 2022

    • Install the nuget package "Microsoft.VisualStudio.VsixColorCompiler" into this project.
      https://www.nuget.org/packages/Microsoft.VisualStudio.VsixColorCompiler/

    • now open a command line console or the VS Terminal (View > Terminal)

    • open the folder for the installed nuget package. You find it here: "C:\Users[Your Username].nuget\packages\17.0.31709.430\VsixColorCompiler.exe" (the version number can maybe differ, if is a new version of the nuget package released in the future.

    • run following command:

    VsixColorCompiler.exe [here your .vstheme file] [here the target folder and name of the oputput with.pkgdef]
    
    // example
    VsixColorCompiler.exe C:\somewhere\myTheme.vstheme c:\whatever\myTheme.pkgdef
    
  • this part is done, we have out pkgdef file!
  1. Now we need to create a VSIX Project inside VS 2022. (Don't forget to install the Extension Workflow, to get the Project)

    • Create an Empty VSIX Project Inside Visual Studio
      01_ScreenShot_vstheme_2022_VSIX_Project

    • use Add Existing Item to add you generated ".pkgdef" file to the project
      02_ScreenShot_vstheme_add_Existing_file

    • change the file property setting as in this image:
      03_ScreenShot_vstheme_file_props

    • optional: edit the manifest file in order to get a nice name for your extension! ;)

    • build the project!

    • go to the output directory and run the created VSIX-File.

Done!

I hope this helps you.

Daniel