Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot generate ADO.NET Model classes

I am using Visual Studio Express 2012 for Web.

I have created a new empty web site using .net framework 4.

I am using SQL Server 2008 R2 Service Pack 2, and I have a database with 4 tables there.

When I try to add a new ADO.NET data model into my website from this database, the Model.edmx, Model.tt, and Model.Context.tt files are all generated, but my Model.cs and Model.Context.cs files are missing. If I try to use the option 'update the model from database' nothing happens.

I have installed Visual Studio just two days ago, and initially I could work with a successfully generated model for another web site. But now I cannot generate the model in any website. I have tried with other databases, to no success.

enter image description here

like image 602
Shuaib Avatar asked May 18 '26 11:05

Shuaib


1 Answers

Thanks to John Saunders for providing this answer as a comment.

Use the Build->Transform T4 Templates command if present, otherwise, right click the .tt files and do Run Custom Tool

like image 178
Shuaib Avatar answered May 21 '26 04:05

Shuaib