Use the local IWizard assembly as WizardExtension in the project template

I have a very simple implementation of IWizard for the sole purpose of adding a parameter variable to the dictionary (no user interaction required).

I do not want to add this to the GAC, if possible.

I put the dll in the root of the zip template file with the vstemplate file and referenced the name in the WizardExtension section:

 <WizardExtension> <Assembly>Wizard.dll</Assembly> <FullClassName>Wizard.Wizard</FullClassName> </WizardExtension> 

I was hoping this would find and use a local copy of the assembly, but it doesn't seem to work.

Can I use the IWizard implementation without installing in the GAC?

+4
source share
2 answers

I finally checked the solution described here .

The idea is that we need to add an assembly that implements IWizard in the GAC, or to any other place that Visual Studio looks for using the assembly assembly mechanism. VS is looking for our template assembly next to it (devenv.exe) in C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE . It also appears in two subdirectories: PrivateAssemblies and PublicAssemblies .

I'm not sure whether to sign our assembly with a strong key or not (I use signed in my case). You can easily check it out.

So, if I am not mistaken, it is impossible to force the assembly to be used directly from your zip template file . To simplify the use and updating of my template, I am going to create a small installation project.

Last note. As far as I know, you should not specify the .dll extension of your assembly in the Assembly tag. This is how I write the vstemplate part for my build extension wizard:

  <WizardExtension> <Assembly>WpfTaskTemplateWizard, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=22050f445905b871</Assembly> <FullClassName>WpfTaskTemplateWizard.UIWizard</FullClassName> </WizardExtension> 
+2
source

I know this is kind of old (and the story-teller refused this question), but one extremely charming way to solve this is to Export the Master template . You can export your project template as a VSIX plugin and create a wizard assembly along with the plugin. There is no need to register it with the GAC in this way.

+1
source

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


All Articles