定制"一个ASP.NET"的Visual Studio 2013中的项目模板 [英] Custom "One ASP.NET" Project Templates within Visual Studio 2013

查看:125
本文介绍了定制"一个ASP.NET"的Visual Studio 2013中的项目模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

集成在Visual Studio中的项目模板2013的一号ASP.NET集合。

Integrate project templates within Visual Studio 2013's "One ASP.NET" collection.

在分发项目开始作为一个新的 ASP.NET Web应用程序的项目,使用空缺模板和MVC和Web API文件夹和引用检查。从那里,我说我的爱情和亲情,并使用导出模板即可。在拉链的土地我的文档>的Visual Studio 2013>我导出模板。如果您的Visual Studio安装的模板,你重复拉链被放置在我的文档>的Visual Studio 2013>模板> ProjectTemplates 。这里是哪里出了问题开始了......

The "to be distributed" project began as a new ASP.NET Web Application project, using the Empty template and the MVC and Web API "folders and references" checked. From there I added my love and affection and used Export Template. The zip lands in My Documents > Visual Studio 2013 > My Exported Templates. If you have Visual Studio install the template for you, a duplicate zip is placed within My Documents > Visual Studio 2013 > Templates > ProjectTemplates. Here's where the problem begins...

在Visual Studio中的模板内的的Visual C#的树枝,而不是一个自定义模板的中找到的在 ASP.NET Web应用程序模板。无赖。更奇,模板安装只 C#而非其网络子文件夹。

In Visual Studio the template is found within the Visual C# tree branch, not a custom template within the ASP.NET Web Application template. Bummer. Even more odd, the template installs only to C# and not to its Web sub-folder.

MSDN在线文档提到< ProjectSubType> .vstemplate 文件,当我调查了这是空的内,但即使明确添加Web并未改变UI位置。这无关我的目标真的,但它似乎表明,VS2013不会在 .vstemplate

MSDN documentation online mentioned a <ProjectSubType> within the .vstemplate file, which was empty when I investigated, but even explicitly adding Web did not change the UI location. This nothing to do with my goal really, but it seems to suggest that VS2013 does not honor some of the XML within .vstemplate?

我开始通过程序文件(x86)\\微软的Visual Studio 12.0 \\ Common7 \\ IDE \\ ProjectTemplates \\ 和的古怪的事情,我注意到一个是两个独立的挖文件夹树: {ROOT} \\网络\\ CSHARP \\ 1033 {ROOT} \\ CSHARP \\网络\\ 1033

I started digging through the Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ProjectTemplates\ and one of the oddball things I noticed was two separate "folder trees": {root}\Web\CSharp\1033 and {root}\CSharp\Web\1033.

举行WebTemplate45及其项目 WebApplication45Dev12.vstemplate 说明第一棵树的项目类型 ProjectSubtype 值如上所述。 Mimicing这并没有改变aything。

The first tree held WebTemplate45 and its project WebApplication45Dev12.vstemplate illustrating the ProjectType and ProjectSubtype values mentioned above. Mimicing this did not change aything.

第二棵树还与 WebTemplate.vstemplate A WebTemplate45包括在内。这一次是很显著不同,因为它的键入= ProjectGroup ,它引用的 TemplateGroupID 和好奇则引用 OneASPNetProjectTemplateWizard WizardExtension 标记。我的猜测是,这是一个显示这些showen显示的图像中的爸爸模板。

The second tree also held a WebTemplate45 with WebTemplate.vstemplate included. This one was was significantly different because its Type=ProjectGroup and it referenced a TemplateGroupID and curious WizardExtension tag that referenced the OneASPNetProjectTemplateWizard. My guess is this is the daddy template that displays those showen in the image displayed.

怎样才能在一个ASP.Net弹出交付项目包?注册表的改变? VSIX?

What does it take to deliver a project package in the "One ASP.Net" popup? Registry alterations? VSIX?

如果这是不可能,反正是有克隆的所有自定义项目的爸爸窗口?防爆。想象一下,仅上市公司的子模板显示的窗口。

If it is not possible, is there anyway to clone the daddy window for all custom projects? Ex. imagine the window displayed with only a company's child templates listed.

<一个href=\"http://msdn.microsoft.com/en-us/library/xwkxbww4.aspx\">http://msdn.microsoft.com/en-us/library/xwkxbww4.aspx

<一个href=\"http://www.asp.net/mvc/tutorials/mvc-4/custom-mvc-templates\">http://www.asp.net/mvc/tutorials/mvc-4/custom-mvc-templates

推荐答案

您看过约翰·帕帕热毛巾MVC样?的http://visualstudiogallery.msdn.microsoft.com/1eb8780d-d522-4dcf-bf56-56f0eab305c2

Have you seen the Hot Towel MVC sample from John Papa? http://visualstudiogallery.msdn.microsoft.com/1eb8780d-d522-4dcf-bf56-56f0eab305c2

打开VSIX文件在WinRAR,关键位, <$c$c>HotTowelSpa.2013.vsix\\ProjectTemplates\\HotTowelSpaProjectTemplate.cshtml\\HotTowelSpaProjectTemplate.cshtml.vstemplate,似乎是:

Opening the VSIX file in WinRAR, the key bits, in HotTowelSpa.2013.vsix\ProjectTemplates\HotTowelSpaProjectTemplate.cshtml\HotTowelSpaProjectTemplate.cshtml.vstemplate, seem to be:

<ProjectType>CSharp</ProjectType>
<ProjectSubType>Web</ProjectSubType>
<TemplateGroupID>Web</TemplateGroupID>

修改

事实上,它看起来像你必须指定,具体而言,该项目的类型是MVC:
http://www.asp.net/mvc/tutorials/mvc -4 /自定义MVC模板

Indeed, it does look like you have to specify, specifically, that the project type is MVC: http://www.asp.net/mvc/tutorials/mvc-4/custom-mvc-templates

从页面:

每个元素的类型的属性必须被设置为
  Microsoft.VisualStudio.Mvc.Template。这是一个自定义命名空间
  只有MVC项目向导理解。

The Type attribute of each element must be set to Microsoft.VisualStudio.Mvc.Template. This is a custom namespace that only the MVC project wizard understands.

只需添加文件到VSIX不足以登记
  与MVC向导模板。您需要提供的信息,如
  模板名称,描述,支持视图引擎和编程
  语言MVC的向导。这个信息是在自定义携带
  属性为每个vstemplate元素关联
  文件中。

Just adding the files to the VSIX is not sufficient to register the templates with the MVC wizard. You need to provide information such as the template name, description, supported view engines and programming language to the MVC wizard. This information is carried in custom attributes associated with the element for each vstemplate file.

展望 extensions.vsixmanifest ,我确实看到&LT;资产......项目类型=MVC... 和>标记

Looking in extensions.vsixmanifest, I do indeed see <Asset ... ProjectType="MVC"... and the assets marked with Type="Microsoft.VisualStudio.Mvc.Template"

这篇关于定制&QUOT;一个ASP.NET&QUOT;的Visual Studio 2013中的项目模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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