创建项目模板 - 问题 [英] Creating Project template - Issue

查看:80
本文介绍了创建项目模板 - 问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试创建项目模板。一旦我创建了,我将zip文件放在适当的文件夹中。现在我可以在新项目向导中访问模板。

I am trying to create project template. once i have created, i put the zip file in appropriate folder. Now i can access the template in the new project wizard.

我的问题是,我想创建这样的模板,

My question here is, I would like to create templates like this,

file- >新项目 - > visual C# - > myproject_template - > myproject_template_type(如web api,web,empty,asp.net表单)。

file-> new project-> visual C# -> myproject_template -> myproject_template_type (like web api, web, empty, asp.net form).

如何做到这一点?

推荐答案

欢迎来到MSDN论坛。

Welcome to MSDN forum.

请看看在线程: https://stackoverflow.com/questions/35220473/visual- studio-template-adding-to-custom-group


  1. 在解决方案中选择与您的模板对应的.vstemplate文件    资源管理器。
  2. 在属性窗口中,设置Category属性。

如果包含模板的项目是一个可扩展性项目(项目类型guid 82b43b9b-a64c-4715-b499-d71e9ca2bd60)。

This property is available if the project that contains the template is an extensibility project (project type guid 82b43b9b-a64c-4715-b499-d71e9ca2bd60).

如果检查csproj中的.vstemplate文件,您会注意到名为OutputSubPath的元素将是添加,如下例所示:

If you check the .vstemplate file inside the csproj, you will notice that a element named OutputSubPath will be added, like in this example:

  < ItemGroup>

  <ItemGroup>

    < VSTemplate Include =" Module.vstemplate">

    <VSTemplate Include="Module.vstemplate">

      < SubType> Designer< / SubType>

      <SubType>Designer</SubType>

      < OutputSubPath> ELEVATION< / OutputSubPath>

      <OutputSubPath>ELEVATION</OutputSubPath>

    < / VSTemplate>

    </VSTemplate>

  < / ItemGroup>

  </ItemGroup>

此外,这里还有一些博客可以讨论这个问题:

Besides, here also have some blogs to talk about this:

http://www.dotnetfunda.com/articles/show/1899/creating-a-new-category-for-custom-templates-with-a-new-entry-to-insta

http://blog.majcica .com / 2014/11/28 / custom-category-for-visual-studio-templates /

HTTPS://社会。 msdn.microsoft.com/Forums/vstudio/en-US/c22a932b-afeb-47d3-a140-761ec0f37b1c/template-how-to-create-new-category-for-custom-templates?forum=vsx < a href ="http://blog.majcica.com/2014/11/28/custom-category-for-visual-studio-templates/"> 最佳
问候,

https://social.msdn.microsoft.com/Forums/vstudio/en-US/c22a932b-afeb-47d3-a140-761ec0f37b1c/template-how-to-create-new-category-for-custom-templates?forum=vsxBest regards,

Joyce

注意:

此响应包含对第三方万维网站点的引用。微软提供此信息是为了方便您。  Microsoft确实如此不控制这些网站,也没有测试在这些网站上找到的任何软件或信息;因此,
Microsoft不能就那里发现的任何软件或信息的质量,安全性或适用性做出任何陈述。


这篇关于创建项目模板 - 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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