NOTE: I have looked at this link and disabled CustomTools and still receive this error: MvcTextTemplateHost not found
I am trying to create custom Views in one command for Create, Update, Details, Filter, and List operations. I am able to add them one at a time by right clicking and choosing New View, but when I type Scaffold AddView SampleModel I get the following error message:
The type or namespace name 'MvcTextTemplateHost' could not be found (are you missing a using directive o开发者_如何学JAVAr an assembly reference?).
The template file is AddView.cs.t4. I tried renaming it to .tt but I cannot get the Powershell to look for a .tt file. Any ideas?
MvcScaffolding uses its own custom template host and does not use the MvcTextTemplateHost. I would take a look at the T4 templates that are included with the MvcScaffolding NuGet package. The beginning of one of these templates is shown below.
<#@ Template Language="C#" HostSpecific="True" Inherits="DynamicTransform" #>
<#@ Output extension="aspx" #>
<# var viewDataType = (EnvDTE.CodeType) Model.ViewDataType; #>
精彩评论