microsoft / theme-converter-for-vs

CLI tool that allows you to convert your VS Code color theme to a VS 2022 color theme.
MIT License
502 stars 53 forks source link

Fatal error running VsixColorCompiler.exe #28

Closed huguesv closed 3 years ago

huguesv commented 3 years ago

There's an issue with the color compiler that is included in VS 2022 Preview 3 (it has already been fixed for upcoming Preview 4).

If you see this error:

Microsoft(R) Visual Studio(R) Vsix Color Compiler version 16.0.0.4.
(C) Microsoft Corporation. All rights reserved.
Could not load file or assembly 'Microsoft.VisualStudio.PkgDef, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

System.ApplicationException: Fatal error running VsixColorCompiler.exe
   at ThemeConverter.Program.CompileTheme(String deployInstall) in C:\Users\huvalo\source\repos\theme-converter-for-vs\ThemeConverter\ThemeConverter\Program.cs:line 134
   at ThemeConverter.Program.Convert(String filePath, String pkgdefOutputPath, String deployInstall) in C:\Users\huvalo\source\repos\theme-converter-for-vs\ThemeConverter\ThemeConverter\Program.cs:line 107
   at ThemeConverter.Program.Main(String[] args) in C:\Users\huvalo\source\repos\theme-converter-for-vs\ThemeConverter\ThemeConverter\Program.cs:line 69

WORKAROUND

Open this file in a text editor like notepad as administrator

<vsinstalldir>\VSSDK\VisualStudioIntegration\Tools\Bin\VsixColorCompiler.exe.config

Change this line

<bindingRedirect oldVersion="2.0.0.0-99.99.99.99" newVersion="16.0.0.0" />

to

<bindingRedirect oldVersion="2.0.0.0-99.99.99.99" newVersion="17.0.0.0" />
fisheva commented 3 years ago

Thanks! It worked.

nestevez commented 3 years ago

@huguesv this didn't work for me. Any chance there's more steps I'm missing?

huguesv commented 3 years ago

With the latest changes, we no longer depend on VsixColorCompiler.exe