The vstemplate file references the wizard class Blazor.IWizardImplementationRoot which does not exist in the assembly when migrate extension to VS2022

803 views Asked by At

I am maintaining the Visual Studio extension for the Blazor platform which is using to create the new Blazor application with my custom components. Currently I am using the below installation target in my manifest file to install the VSIX in VS2019

<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[16.3.29209,17.0)"/>

I thought to provide the VS2022 support too for my custom Blazor project template extension. So, I have tried the below Installation target in my manifest file.

<Installation>
        <InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[16.3.29209,18.0)">
            <ProductArchitecture>amd64</ProductArchitecture>
        </InstallationTarget>
    </Installation>

The VSIX has been installed successfully in VS2019 and VS2022 after this changes. But the custom wizard which is developing by the IWizard interface is not loading in VS2022 while trying to create my custom blazor project template. So, I have followed the steps below to migrate my extension to VS2022 (Note: I thought after the migration my VSIX will be working on both VS2019 and VS2022)

  1. Change the framework to 4.7.2 in my VSIX and custom wizard application
  2. I have removed all the framework assemblies from my VSIX and wizard application and installed the below two NuGet packages as package reference
<PackageReference Include="Microsoft.VisualStudio.SDK">
      <Version>17.0.0-previews-1-31410-258</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.TemplateWizardInterface">
      <Version>17.0.0-previews-1-31314-256</Version>
</PackageReference>

Now my VSIX and wizard application has been compiled and debugging successfully in VS2022 and my extension working as expected in VS2022. But in VS2019 I have faced the issue like “The vstemplate file references the wizard class Blazor.IWizardImplementationRoot, which does not exist in the assembly”

Is there any changes need to run my extension both the VS2019 and VS2022 with the single VSIX instead of the separate VSIX?

Please suggest the solution to fix this issue and provide the steps to provide the VS2022 and VS2019 support in the single VSIX instead of maintain the separate VSIX project and separate VSIX file. Because we are publishing our VSIX file in the Visual Studio market place. if we are maintaining the separate VSIX file we can’t publish the VSIX file for VS2022

Thanks,

Ganesan R.

1

There are 1 answers

3
Jimmy On

Have you followed the documentation for migrating extensions to VS2022?

For example, I see you've tried to combine your installation target, but the docs show to do them separately, as <17.0 requires ProductArchitecture to be x86 and >=17.0 requires it to be amd64:

<Installation>
   <InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[16.3.29209,17.0)">
      <ProductArchitecture>x86</ProductArchitecture>
   </InstallationTarget>
   <InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[17.0,18.0)">
      <ProductArchitecture>amd64</ProductArchitecture>
   </InstallationTarget>
</Installation>

However, depending on what kind of other code your extension contains, you may need to split into separate VSIXes. This is due to breaking changes between the reference assemblies for VS itself.