3

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

Shuaib
  • 779
  • 2
  • 13
  • 47
  • 2
    Use the Build->Transform T4 Templates command if present, otherwise, right click the .tt files and do Run Custom Tool. – John Saunders Jul 05 '14 at 20:42
  • Which steps did you take to create your project? I have had this issue before when I selected the wrong project type. – Simon Jul 05 '14 at 22:00
  • @JohnSaunders right clicking the tt files and doing run custom tool did the trick .... thanks a lot – Shuaib Jul 05 '14 at 22:23
  • @Simon I created an empty ASP.NET Website ..... then straightaway I right clicked the project in solution explorer and selected add new ADO.NET Data Model – Shuaib Jul 05 '14 at 22:25

1 Answers1

4

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

Shuaib
  • 779
  • 2
  • 13
  • 47