ASP .Net Entity Framework .tt Files Not Nesting Under .edmx

烂漫一生 提交于 2019-12-19 19:59:09

问题


I'm running an ASP .NET (v4.5) Web Site Project under VS 2012 Update 2. When I create a new entity model (.edmx) under the App_Code folder, nested under the .edmx file is only the .Designer.cs and the .edmx.diagram files. The associated .tt files are not nested. I think this is why, when I save the model, the T4 templates are not automatically transformed, even though that option is specified in the model properties.

Any ideas how to get this working? I cannot use the DependentUpon XML tag in a project file, since Web Site Projects do not have project files.


回答1:


Web Site does not support Nested Project Files, whereas Web Applications support it.I highly you suggest to use a Web Application.

The only way that I found in past is to Run Manually T4 (Right Click on a TT File) or use a pre build event to run T4.




回答2:


Open the .tt file and choose save. This runs the T4 template.



来源:https://stackoverflow.com/questions/16270356/asp-net-entity-framework-tt-files-not-nesting-under-edmx

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