none
Entity Framework 5 - Doesn't generate classes RRS feed

  • Question

  • Hi,

    I started a new project recently, and I choose to do it in VS12 and with EF5.

    I followed this walkthrough http://msdn.microsoft.com/en-us/data/jj205424 to see if anythings changed than before.

    However I'm doing it like it say, the classes are not generated, and therefor I can't use it.

    Anyone have an idea on this ? or how I could find out if something wrong, like the logs of the T4 ?

    Thank you.

    Tuesday, September 18, 2012 2:21 PM

All replies

  • Hi,

    When you say the classes are not created do you mean that nothing appears on the designer surface after you have added the entities?


    We are seeing a lot of great Entity Framework questions (and answers) from the community on Stack Overflow. As a result, our team is going to spend more time reading and answering questions posted on Stack Overflow. We would encourage you to post questions on Stack Overflow using the entity-framework tag. We will also continue to monitor the Entity Framework forum.

    Tuesday, September 18, 2012 3:40 PM
    Moderator
  • Model.cs and Model.Designer.cs are desperately empty and I don't see the generated cs files for the entities like the walkthrough.

    Strangely, the Context cs file is generated with the list of the entities  which are indeed red because it can't resolve the objects.

    Tuesday, September 18, 2012 4:59 PM
  • Hi azaret;

    Did you execute the BloggingModel.edmx.sql script that was created when you right clicked on the designer and selected "Generate Database from Model"? After doing that you will need to compile the project so that the other classes get generated from the *.tt templates.

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Tuesday, September 18, 2012 5:08 PM
  • I did generate and executed the sql script.

    But I can't compile the project as it fails with the "type or namespace not found" error for each entities.

    Tuesday, September 18, 2012 7:18 PM
  •   

    Can you zip the test project you created and upload it to SkyDrive or to some other web site where we can download it. If so I will take a look at it.


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Tuesday, September 18, 2012 7:37 PM