none
Forcing code generation from model RRS feed

  • Question

  • VS2010 - EF 4.0

    I am a complete newbie with Entity Framework, so I probably screwed something up -- but

    Started a Class Library project and, using EF 4.0, built a model from a SQL Server Express 2010 R2 database. So far so good. The Model.Designer code file generated just fine.

    Played with adding a Navigation Property - received an error. Deleted the offending addition. Now the model diagram is back to where I started and there are 0 Errors, 0 Warnings and 0 Messages.

    Unfortunately,the Model.Designer code file now has only the message:

    ' Seeing this comment implies that the code generation for file 'D:\parsellj\proper\path\to\Model1.edmx'
    ' failed. See the ErrorList for details.

    The Errorlist is no help since, as I said, there are 0 Errors, 0 Warnings and 0 Messages.

    Any help will be appreciated.

    Jim Parsells

    Wednesday, January 25, 2012 6:14 AM

Answers

  • Hi Jim,

    Thank for sending me the project!  Same as you said in the second mail you sent me, the designer codes can be generated successfully in a new project, if we add the .edmx file into a new project, the codes are generated successfully. 

    For the original project, actually I don't think it's broken.   We can modify the .edmx file in the EDM designer like moving any entity class a little bit, then the designer codes will be generated again without any problems.   The original error shows the model has some problems, but after you fixed it, somehow the designer codes do not generated.  Here we just need to give VS another chance to re-generate the codes based on a correct model file.  :)  

    Good day!

    Thanks


    Michael Sun [MSFT]
    MSDN Community Support | Feedback to us
    • Marked as answer by HardWay Thursday, January 26, 2012 5:22 PM
    Thursday, January 26, 2012 6:47 AM
    Moderator

All replies

  • Hi Jim,

    Is it convenient for you to send me the demo project for further investigation?   You can directly ping me at misun@microsoft.com.

    Good day!

    Thanks


    Michael Sun [MSFT]
    MSDN Community Support | Feedback to us
    Wednesday, January 25, 2012 7:34 AM
    Moderator
  • Hi Jim,

    Thank for sending me the project!  Same as you said in the second mail you sent me, the designer codes can be generated successfully in a new project, if we add the .edmx file into a new project, the codes are generated successfully. 

    For the original project, actually I don't think it's broken.   We can modify the .edmx file in the EDM designer like moving any entity class a little bit, then the designer codes will be generated again without any problems.   The original error shows the model has some problems, but after you fixed it, somehow the designer codes do not generated.  Here we just need to give VS another chance to re-generate the codes based on a correct model file.  :)  

    Good day!

    Thanks


    Michael Sun [MSFT]
    MSDN Community Support | Feedback to us
    • Marked as answer by HardWay Thursday, January 26, 2012 5:22 PM
    Thursday, January 26, 2012 6:47 AM
    Moderator
  • Michael,

     

    Thanks. That doew work. I suspected that making a change would inspire a regeneration of the code. I did not realize that simply moving an entity in the diagram was enough of a change to do that.  I am puzzled as to why deleting the offending Navigation did not also inspire a regeneration, but that is of no real importance to me.

    Thanks,
        Jim

    Thursday, January 26, 2012 5:27 PM