Invalid Link Build Wizard on VSIX Deployed Template

I am trying to create a VISX extension for Visual Studio 2010 that contains several project templates. These templates are not very complex, but I want to provide them with additional configuration during creation using the wizard. I have successfully configured my VISX package to deploy the templates in the directory structure that I want in VS2010, but as soon as I try to configure and run the wizard, I get an error when I create the template line by line:

Error: this template tried to load the component assembly 'My.Assembly, Version 1.0.0.0, Culture = neutral, PublicKeyToken = ...

My current configuration is as follows:

  • All projects live in the same solution.
  • A VISX project includes project links to a project containing wizards and each template.
  • Each template is built from a project template template (... confusing terminology).
  • They are added through the .vsixmanifest constructor as content, referencing projects.
  • Each .vstemplate file has a WizardExtension element that points to an IWizard implementation and contains an assembly.
  • The wizard assembly is signed.

The .vstemplate files point to their wizard like this:

<WizardExtension>

<Assembly> My.Assembly, Version = 1.0.0.1, Culture = neutral, PublicKeyToken = a494da9e6e53f845, Custom = null </ Assembly>

<FullClassName> My.Assembly.Wizard </FullClassName>

</WizardExtension>

This, as far as I can tell, is how I should do it. What exactly is going wrong? Looks like he can't find the assembly. Are there any other steps I need to take to get the assembly visible to the templates? The assembly is deployed to the extension folder when it is installed (I checked it), so it at least does it. Is there anything special I need to do with .vstemplate files in order to get them to look into the extensions folder against the GAC? Did I miss something?

Please note that I found several pages on the Internet that indicate that I should build the GAC manually or using a script. However, few had my exact scenario (project template templates referenced by a VISX project, most examples use a regular project exported using the project template wizard, and their packages are dumped into the VISX folder structure). The only one I found that matched my scenario was an example from Microsoft. I tried to match this, but alas, it still doesn't work. I tried to move the project that I downloaded to refer to this question, but I can not find it again.

Using scripts is the way we did it before, but I want to try and make it a little cleaner using VISX packages. I would like to avoid this, but if it is mandatory for the VISX script to install the template in the GAC, I can do it.

+6
source share
3 answers

When deploying a wizard-based project template using the VSIX Extension, it is best to use the Short-Named node in .vstemplate. This can prevent the deployment of the GAC.

In your case, it should be:

<WizardExtension> <Assembly>My.Assembly</Assembly> <FullClassName>My.Assembly.Wizard</FullClassName> </WizardExtension> 
+2
source

I am using VS2015 and have encountered this problem. When I started creating a VSIX project using the Wizard, it worked fine all the time (4-6 weeks), and suddenly it stopped working. After a couple of weeks, it will start working again and will stop working without warning. It took me a long time to find a workaround (I still don’t know why it suddenly stops).

This is how my VSIX project is built

  • I have a VSIX project, a project template, and a wizard implementation into the same solution.
  • Implementation of VSIX and Wizard is performed in one project.
  • Added VSIX project DLL and project template as assets in VSIX project source.extension.vsixmanifest.
  • The * .vstemplate project template contains a wizard section that refers to a VSIX project with a strong name: & L; <<<<<<<<<<<<<<<<<<<<<<<<

     <WizardExtension> <Assembly>Test.Template.TemplateInstallerWizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30ab381f68dc4f5e</Assembly> <FullClassName>Test.Template.TemplateInstallerWizard.WizardImplementation</FullClassName> </WizardExtension> 

None of them worked for me

  • Remote extension from regular VS instance via Tools-> Extensions and updates ..
  • Remote extension from experimental VS instance launching VS exp instance from VS2015 command line as administrator:

    devenv.exe / rootsuffix exp

    and then remove the extension through Tools-> Extensions and Updates ..

  • Using assembly with short names, as explained by @Ethan Wu.

  • Installing templates using this command from the VS2015 command line starts with administrator rights:

    devenv / installvstemplates

  • Rebooting VS2015, my machine several times during this process.

This is what worked for me (thanks @Ethan Wu)

  • Remove certificate from VSIX project.

Remove strong name from project template * .vstemplate file
  <WizardExtension> <Assembly>Test.Template.TemplateInstallerWizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</Assembly> <FullClassName>Test.Template.TemplateInstallerWizard.WizardImplementation 

Clean and create a project.

Remove the extension from a regular instance of VS and close VS2015 (not absolutely necessary)

Install the extension.

Open a new instance of VS2015 and try to create a project using the wizard.


A few things to help debug

  • When the VSIX project is created, in the bin \ debug folder, the created -extension.vsixmanifest file, which has an asset type, is created.

  • Have a look at Asset Type = "Microsoft.VisualStudio.Assembly": The value of AssemblyName is what is expected in the project template. * .vstemplate WizardExtension - they must exactly match.

  • After installing the extension, go to the VS2015 extension section on the local block:

     %appdata%\..\Local\Microsoft\VisualStudio\14.0\Extensions\<some_temp_folder> 

    open extension.vsixmanifest to ensure that Asset Type = "Microsoft.VisualStudio.Assembly" The value of AssemblyName is correctly populated. If necessary, you can change this value and restart VS2015 to do this.

I hope this helps someone and save a lot of time, since it helps very little in the Wizard and custom project templates.

Thanks,

RDV

0
source

I ran into the same problem, but mine showed up when I updated the AssemblyVersion my project wizard. I checked and the versions in the manifest files matched, as it should.

I just logged in to C:\Users\Albert\AppData\Local\Microsoft\VisualStudio\16.0_c340331cExp\Extensions , found my extension and deleted it there. Now it works again.

(Please note that I found several others, since then I changed the name of the company, etc. In the AssemblyInfo file, so these may be old ones that were also the reason for this)

0
source

Source: https://habr.com/ru/post/918793/


All Articles