且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我如何创建ASP.NET MVC 3我自己的脚手架模板?

更新时间:2023-02-25 21:46:27

ASP.NET MVC使用T4模板。 Here's概述。

ASP.NET MVC uses T4 templates. Here's an overview.

下面的步骤是:


  1. 在程序包管理器控制台类型:安装包MVC3 codetemplatescsharp

  2. 接受所有的警告

  3. codeTemplates 文件夹将被添加到包含模板项目

  1. In the Package Manager Console type: install-package mvc3codetemplatescsharp
  2. Accept all the warnings
  3. The CodeTemplates folder will be added to your project containing the templates

在这里,您既可以修改现有模板或添加新的。

From here you could either modify the existing templates or add new one.

或者,如果你想在全球范围内修改这些你可以到这个在 C:\\ Program Files文件(x86)的\\微软的Visual Studio 10.0 \\ Common7 \\ IDE \\的ItemTemplate \\ CSHARP \\网络\\ MVC 3 \\ codeTemplates \\ 文件夹中。

Or if you want to modify those globally you could to this in the C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Web\MVC 3\CodeTemplates\ folder.