如何在项目模板中使用VsixMainfest附带的向导程序集? [英] How to use wizard assemblies attached in VsixMainfest in project templates?
问题描述
我有一个带有程序集属性的vsixmanifest文件.该文件如下所示:
I have a vsixmanifest file that has an assembly attribute. The file looks like:
<Content>
<ProjectTemplate>Solution</ProjectTemplate>
<Assembly AssemblyName="SolutionNameWizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1c39bfcc-223f-4c12-a5dc-55eeca7c61f7">
Assemblies\SolutionNameWizard.dll
</Assembly>
我知道程序集名称和公钥正确.
I know that the assembly name and public key are correct.
现在,我正在尝试在一个模板中使用此程序集.现在我有:
Now, I am trying to use this assembly in one of my templates. Right now I have:
<WizardExtension>
<Assembly>SolutionNameWizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1c39bfcc-223f-4c12-a5dc-55eeca7c61f7</Assembly>
<FullClassName>SolutionNameWizard.IWizardImplementation</FullClassName>
</WizardExtension>
有什么我想念的吗?当我运行vsix时,出现以下错误:
Is there something that I am missing? When I run the vsix I get the following error:
A problem was encountered creating the sub project 'test.Web' Error: this template
attemtped to load component assembly 'SolutionNameWizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1c39bfcc-223f-4c12-a5dc-55eeca7c61f7'.
我知道模板要求程序集位于GAC中,当我使用vsix时也是如此吗?我希望避免使用GAC并仍然使用我的向导.
I know that templates require the assembly to be in the GAC, is that also the case when I am using vsix? I was hoping to avoid the GAC and still use my wizard.
编辑:我已按照答案中的建议将公钥更改为正确的字符串,但是仍然存在问题.
I changed the public key to the proper string as suggested in the answers, but am still having the issue.
除了以下有用的答案外,这是我在完成此过程后所写的博客.它链接到一堆我认为非常有帮助的文章: https://thebhwgroup.com/blog/2013/10/visual-studio-templates
Edit 2: in addition to the helpful answer below, here is a blog that I wrote after I finished this process. It links to a bunch of articles that I found to be very helpful: https://thebhwgroup.com/blog/2013/10/visual-studio-templates
推荐答案
If anyone else happens to stumble upon this question, I ended up following this guide: http://blog.tonysneed.com/2011/09/14/build-a-multi-project-visual-studio-template/
这使该过程(大部分)变得非常容易.如果有人碰巧遇到类似问题,请随时与我联系,我可以尝试分享我学到的知识.
It made the process (mostly) very easy. If anyone happens to run into similar issues, feel free to contact me and I can try to share what I learned.
编辑:这是我完成此过程后写的简短博客文章.对于偶然发现此问题的人可能会有所帮助: http://www .thebhwgroup.com/blog/2013/10/visual-studio-templates/
here is short blog article I wrote after completing this process. It might be helpful for someone who stumbles upon this: http://www.thebhwgroup.com/blog/2013/10/visual-studio-templates/
这篇关于如何在项目模板中使用VsixMainfest附带的向导程序集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!