none
Enty Data Files are not fully regenerating after adding stored procedure RRS feed

  • Question

  • I am using Visual Studio 2012 Entity Framework 5 with code that has been fully checked ouf Teamserver source control (I esnured all files associated with the edmx file are check out). I add a stored procedure via the Update wizard. The stored prcodure appears in the Model Browswer but when I go to reference it via the a context it is not seen. I am noting the <Model>.Content.cs is not being updated. I can blow the file away and recreated it and add the stored procedure. All gets generated as it should and I can reference the stored procedure via the context reference.

    any ideas why the stored procedure wrappers are not generating?


    Virginia From Virginia


    Monday, May 20, 2013 4:43 PM

Answers

  • Turns out it was a difference of Myself being on Visual Studio 2012 Service Pack 1 and my co-developer being on Visual Studio 2012 Service Pack 2.  She created the Entity frame work file and checked it in and when I checked it out and interacted with it, I did was unable to add to it as she did.


    Virginia From Virginia

    Tuesday, June 11, 2013 12:24 PM

All replies

  • Hi Virginia,

    Sorry I'm not sure what do you mean by "but when I go to reference it via the a context it is not seen".

    Do you mean the .Context.cs file is not updated? Would you like to check if <Model>.edmx file is updated? If it is updated, <Model>.Context.cs file may also get updated since it will be generated by <Model>.Context.tt T4 template.

    Best regards,


    Chester Hong
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, May 21, 2013 9:47 AM
    Moderator
  • Hi,

    Yes I mean the .Context.cs is not updating.  the <Mode>.edmx is updating - I looked at it in notepad.  I really think that Teamserver is putting a lock on these files even though they are check out.  I have even tried the custom tool on the edmx right click menu which did nothing.  Any suggestions,

    Thanks, Virginia


    Virginia From Virginia

    Tuesday, May 21, 2013 11:42 AM
  • Hi Virginia,

    Thanks for the detailed information. I'll try to involve some other engineers more familiar with the issue in this thread.

    It may take some time to get the response. Your patience will be appreciated.

    Thanks for your understanding.

    Best regards,


    Chester Hong
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, May 22, 2013 7:54 AM
    Moderator
  • I am unable repro the issue. Can you please create a stand alone solution with minimum code to repro the issue? Please use Adventureworks database so that we can refer to the same StoredProc. Please zip your entire solution into a single zip file and email it to me: cts-enamulkh@live.com (be sure to remove all your business logic from the repro)
    Friday, May 31, 2013 12:15 AM
  • Haven't received the repro yet. If your issue has been resolved or you do not need further assistance, please let us know.
    Wednesday, June 5, 2013 12:49 AM
  • Hi,

    Before I do that woudl thsi be an issue of versions and who created the edmx file and checked it in.

    I am working with a .Net 4.5 Web Application in Visual Studio 2012.  We are storing this code in Visual Studio Team Foundation Server 2010 source control.  There are two developers working on this Web Application.  The other developer created the Entity Framework 5.0 Change_Management.edmx file and initial set up of the Connection to the database along the Entities (tables) to connect to.  She checked this file in along with other code in our Team Foundation Source Control.  I came behind and checked the code out the edmx file.  I ensured the corresponding VS generated files were checked out as well.  I added a stored procedure to the edmx file.  This file updated but the corresponding wrappers that should have been created in the Change_Management.Context.cs file did not get generated.  Consequently my attempt to code out the stored procedures via the Context point would not compile.  The other developer was able to check out the code and add stored procedure without issue.   I was able to delete the Change_Management.edmx file, then recreate the file selecting the stored procedures along with the tables and views and all generated as it should. 

    I have written another .Net 4 Web Application in Visual Studio 2012 with an Entity Framework 5.0 edmx file for the database connection.  I have checked this code in and checked it out.  I have added stored procedures to this file and the supporting wrapper code was generated in the Context.cs file as it should.  My feeling is there is some lock put on by the Team Foundation Server the Entity Framework 5.0 VS generated files such that the VS cannot generated the code need when the edmx file is changed.  I saw this happen when I tried to refresh the database after I added a column to a view.  The supporting wrapper did not have the entry added. 

    Thanks, Virginia


    Virginia From Virginia

    Wednesday, June 5, 2013 12:17 PM
  • It seems to me some kind of file-level locking on VS-generated files that prohibited regenerating them. One way to workaround this is to delete your local projects+solutions, and then fetch them fresh from the Team Foundation Server.
    Tuesday, June 11, 2013 12:08 AM
  • Turns out it was a difference of Myself being on Visual Studio 2012 Service Pack 1 and my co-developer being on Visual Studio 2012 Service Pack 2.  She created the Entity frame work file and checked it in and when I checked it out and interacted with it, I did was unable to add to it as she did.


    Virginia From Virginia

    Tuesday, June 11, 2013 12:24 PM