T4 References for 'MvcTextTemplateHost' and 'VisualStudio'

本小妞迷上赌 提交于 2019-12-24 08:58:24

问题


I'm having problems creating MVC 3 T4 template. I have cleared the "Custom Tool" property for the template as MvcTextTemplateHost not found suggests. But I cant find which reference to include.

Also I need to find reference for Microsoft.VisualStudio.Web.Mvc.Scaffolding.BuiltIn, I cant find it in the list of references.

Which references are missing?

TIA

/Lasse


回答1:


Probably the simplest way to go about this is to add the existing code templates to your project with NuGet (install-package Mvc3CodeTemplatesCSharp) and then make a copy of one of the templates or take a look at what references are included in them.




回答2:


Click on controller.tt and go to properties in "custom tool namespace" enter TextTemplatingFileGenerator. and remove from other .tt if there are TextTemplatingFileGenerator.



来源:https://stackoverflow.com/questions/5744120/t4-references-for-mvctexttemplatehost-and-visualstudio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!