ASP .Net Entity Framework .tt Files Not Nesting Un

2020-03-19 02:08发布

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.

2条回答
Viruses.
2楼-- · 2020-03-19 02:15

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

查看更多
Root(大扎)
3楼-- · 2020-03-19 02:41

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.

查看更多
登录 后发表回答