You have probably stumbled upon this video, which explains how to convert your favorite VSCode theme to also be usable in Visual Studio 2022. Well, it's not entirely correct, it still applies, but there has to be some clarification.
As the video lacks some information, I will try to make it as easy as possible.
Table of Contents:
- Toolset: Visual Studio extension development
- VSCode Theme Converter
First, if you can not create an Empty VSIX Project, you most likely have to modify your VS through Visual Studio Installer.
Click modify
on your VS installation -> Workloads -> Other Toolsets
The Empty VSIX Project should now be available.
The video doesn't tell you to install this extension, so install it from here. This is the missing step that makes the Convert to Visual Studio Theme
option appear.
TL;DR:
- set color theme
- open cmd Palette and search for
Generate Color Theme
- save as
<name>.jsonc
First step is to open your VSCode and make sure your theme is currently active: ctrl + shift + x
find and set the color theme. I'm using eppz.eppz-code
for C# with Unity.
Open the Command palette (ctrl + shift + p
) and search for Generate Color Theme
. This command will generate a json file with the current theme definition, which you can later import into new VSIX project.
Save this file as <name>.jsonc
.
Open Visual Studio 2022, create a new project (Empty VSIX Project) and give it a name and hit create
Location is the path for your built project!
Once your new project is ready, hit shift + alt + A
to Add Existing Item. Locate your jsonc
and add it into your project.
Remember to change the file filter to
All Files (*.*)
when locating your theme file, the dialog won't show it by default
The file is now in the project, but I believe the theme conversion step can be skipped, as apparently, Visual Studio seems to be doing that by default with jsonc
files. The manual conversion can be done by right clicking the jsonc
file in the Solution Explorer and selecting Convert to Visual Studio Theme
:
This option will only be available after installing the
VSCode Theme Converter extension
in Visual Studio
This creates a package definition, but it should be created by default, at least in VS Community 2022.
The last step is to add this pkgdef
to the extension assets. Double click the manifest file in the solution explorer, it should be named source.extension.vsixmanifest
, then navigate to the Assets
tab:
Click new
button, in the new window select the following:
- Type:
VsPackage
- Source: File on filesystem
- Path: select your
pkgdef
- it's a dropdown list, which will show the previously added asset
Hit ok
, then build
your project with F6
.
Once the Build is finished, the extension is ready to be installed as a theme. Navigate to your project, then to the output bin/debug/
.
If you haven't changed the default location, it should be under
%HOMEPATH%\source\repos\
then under<project_name>\<solution_name>\bin\debug\
You can now double click the vsix
file and let VS install the extension.
After restarting your VS, navigate to Tools
-> Theme
, select your exported theme, enjoy.