使用VSIX将包含IWizard的组件部署到项目模板 [英] Deploy assembly containing IWizard for project template with VSIX

查看:308
本文介绍了使用VSIX将包含IWizard的组件部署到项目模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为VS 2010创建了一个部署项目模板的扩展。项目模板使用在基于此模板创建新项目时调用的自定义向导(在特定程序集中)。

I have created an extension for VS 2010 that deploys a project template. The project template uses a custom wizard (in a specific assembly) that is called when I create a new project based on this template.

我想将包含VSIX中的向导,以便将其部署到模板可以找到的位置(我知道GAC不是VSIX的选项)。

I want to package the assembly containing the wizard within the VSIX, so that it gets deployed somewhere the template can find it (I know GAC is not an option with VSIX).

基本上如果我将程序集部署到GAC,安装VSIX,然后创建向导被成功调用的项目。
如果我先做相同的部署,那么在创建项目时,项目模板找不到程序集。

Basically if I deploy the assembly to the GAC, install the VSIX and then create the project the wizard is invoked successfully. If I do the same without deploying the assembly first, the project templates does not find the assembly when I create the project.

我的问题是:如何使用VSIX软件包部署项目模板和需要的程序集

My question is: how to deploy a project template and the assembly it needs using a VSIX package?

感谢您的帮助

编辑:我在安装程序项目中将向导程序集引用的VSIX子路径更改为ProjectTemplates,并相应地更新了vsixmanifest内容组件引用。

I changed the VSIX Sub Path of the wizard assembly reference to "ProjectTemplates" in both the installer project and updated the vsixmanifest content assembly reference accordingly. It seems to work now.

推荐答案

您不需要在GAC中获取包含IWizard实现的程序集。您可以在extension.vsixmanifest文件中简单地将其声明为程序集元素

You don't need to get your assembly containing the IWizard implementation in the GAC. You can simply declare it in your extension.vsixmanifest file as an Assembly element in the Content section.

不幸的是,这似乎并没有记录在任何地方。

Unfortunately, this doesn't appear to be documented well anywhere.

唯一的棘手的部分是确保AssemblyName属性具有正确的值。

The only tricky part is making sure that the AssemblyName attribute has the correct value.

这篇关于使用VSIX将包含IWizard的组件部署到项目模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆