4

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

I don't want to have to add this to the GAC if possible.

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

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

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

Is there any way of using an IWizard implementation without installing to the GAC?

starblue
  • 55,348
  • 14
  • 97
  • 151
fearofawhackplanet
  • 52,166
  • 53
  • 160
  • 253
  • Hello. Have you been successful solving this problem? I want to do the same thing. I've found an advice [here](http://stackoverflow.com/questions/5090260/deploy-assembly-containing-iwizard-for-project-template-with-vsix), but I couldn't apply it properly. Hope, you will share your solution. Thank you. – Igor Soloydenko Jan 06 '12 at 21:29
  • Bad news. These resources ([first](http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/dd385ce3-de07-431e-8655-571fd431a686/), [second](http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/792d1b21-9973-4a9a-ba12-67bea314986c)) say that it is possible to implement what we want but the solution has some limitations. The assembly which contains the implementation of IWizard must reside in the IDE's probing path (like ...Common7\IDE, ...Common7\IDE\PublicAssemblies or ...\Common7\IDE\PrivateAssemblies). I haven't checked that yet. – Igor Soloydenko Jan 06 '12 at 23:27
  • See also http://stackoverflow.com/questions/5090260/deploy-assembly-containing-iwizard-for-project-template-with-vsix and the answers there. – itowlson Apr 25 '13 at 23:11

2 Answers2

2

I have finally checked the solution described here.

The idea is that we must add the assembly which implements the IWizard to the GAC or to any other place which Visual Studio looks using the assembly probing mechanism. VS looks for our template assembly near itself (devenv.exe) at C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE. It also looks in two subdirectories: PrivateAssemblies and PublicAssemblies.

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

So, if I am not mistaken, it isn't possible to force the assembly to be used directly from your template zip file. In order to make the usage and update of my template easier I'm going to create a small setup project.

Last note. As far as I know, you mustn't specify the .dll extension of your assembly in the Assembly tag. Here is how I write a vstemplate part for my wizard extension assembly:

  <WizardExtension>
    <Assembly>WpfTaskTemplateWizard, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=22050f445905b871</Assembly>
    <FullClassName>WpfTaskTemplateWizard.UIWizard</FullClassName>
  </WizardExtension>
Igor Soloydenko
  • 11,067
  • 11
  • 47
  • 90
  • 1
    I gave up on this eventually but thanks for sharing your info – fearofawhackplanet Jan 09 '12 at 09:45
  • 3
    Just add [ProvideBindingPath] on your package. – Adam Jan 10 '13 at 17:56
  • It is possible to have the assembly used from your template .zip file: see http://stackoverflow.com/questions/5090260/deploy-assembly-containing-iwizard-for-project-template-with-vsix (Adam's solution is simpler for VS2012, it seems ProvideBindingPath doesn't exist in VS2010). – itowlson Apr 25 '13 at 23:13
1

I know this is kind of old (and the thread starter has given up on the matter), but one extremely charming way to solve this is using Export Template Wizard. You can export your project template as a VSIX plugin and have the wizard assembly packaged along with the plugin. No need to register it in the GAC that way.

Sebastian Edelmeier
  • 4,095
  • 3
  • 39
  • 60