Enitity Data Model Designer is not available for WP7 projects. Why? RRS feed

  • Question



    I'm writing you because VS2010 doesn't allow me to open edmx files using the Enitty Data Model Designer within Windows Phone 7 projects. In fact I cannot neither to add an edmx as a new element nor view with the designer an existing one.


     The point is I'm developing my own t4 transformation to create the datacontext for SQLCE on WP7 from an edmx and would be very useful to have the possibility of opening this kind of files with its proper designer, instead of only be able to edit them with the XML editor.

    Is there any work around for change this behavior of VS2010?


    Thanks in advance!


    • Moved by Mark_Groves Monday, July 11, 2011 4:12 PM (From:Visual Studio Class Designer)
    Saturday, July 9, 2011 5:49 PM

All replies

  • You could add a desktop or web project to you solution?
    Please mark as answer, if this was it. Visit my SQL Server Compact blog
    Monday, July 11, 2011 4:56 PM
  • Actually this is the solution I've been forced to use.

    In my solution I have an edmx file per aggregated. It means I have around 100 edmx files within my WP7 project. The point is it would be easier for every day work to have together each edmx with the classes related with its aggregated (generated files, partial classes files, specifiacitons etc...)

    Currently I have to go to a  different project look for the edmx file for changing it and return to the project with the aggregated in order to run the custom tool to perform the T4 transformation. 

    I've tried to have a link on the WP7 project to each edmx in order to use the 'Locate Source File'. But as soon as I create a link to the edmx file, the edmx turns impossible to open with the designer, neither within  the WP7 project nor the desktop project.


    Thank you for your answer ErikEJ, 



    Monday, July 11, 2011 6:19 PM
  • Hello,

    Thank you for posting.

    Honesty speaking, I didn't very understand what on earth you would want to do. Could you please describe your question more detail?


    Larcolais Gong[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, July 12, 2011 7:08 AM
  • Well, I've just explained my problem not the reason why I work having 100 edmx files. Maybe that's the point why its not clear.
    Let's start from the beginning. Currently there are two approaches to define a db in SQLCE for WP7. You can simply code your POCO classes, adding within them the annotations for mapping them with the db. Within the annotations you include informtion for mapping relations with other POCOs and also indexes information. Furthermore you need to provide a dataContext.
    The other option you can use is SQL Metal or SQL CE Toolbox. They allows you to create in ONE FILE all the POCO classes you need to access the tables and relations you have defined in one sdf file. It is very useful, eventhough it is not very maintenable due to it is a huge file with 140 classes. It is specially true if you want to add extra functionality within your POCOs.
    Another option is to have all my POCOs defined in one edmx file, and modify the EntityFramework T4 POCO generator template to make it returns a valid set of POCOs and datacontext for WP7 SQLCE in different files. This option is specially useful in my case because I have an sdf file of an old data base with tables but without referential constraints defined that I'm going to redesign for the WP7 version of my app. So, I load my POCOs in the edmx from the old database and I use the  Entity Data Model Designer to refactor easily the POCOs. Adding properties to my entities fussing entities and adding asoociations between them. THE PROBLEM is ENTITY DATA MODEL DESIGNER cannot work with and huge ammount of entities, in fact whe I load 110 tables IT FREEZES.
    Finally, the decission I take has been to create an edmx per aggregate. For example the Order aggregate is composed by the POCOs: Order and OrderDetail. The Customer aggregate is composed only by the POCO Customer, and so on ... . Within an edmx file I define all the entities of the aggregate and its internal associations. When I want to define an external association, I include within the edmx the external entity target of the association using the keyword "_EXTERNAL_" at the end of its name. I use this external entity only to be able to define this asociaton the T4 will not generate its related POCO class. So i only need to define the primary key of this EXTERNAL entty and those fields useful to define the relation. At the end, what I have is 2 T4 files one that generates the POCO classes with the SQLce annotations per edmx and another that reads all the edmx to create the datacontext file.
    That's what I'm doing. My only problem is I cannot have my edmx files together with the other files related with an aggregate in the same project, because edmx files cannot be open with the Data Model Designer withing a WP7 project.
    I hope it is more clear now.
    Thank you for your interest. 
    Tuesday, July 12, 2011 9:16 AM
  • Hello again,

    After some researches, I think we generally let client application to access web service and get data what we want. WP Mango supports local database cache, but edmx was not supported. I suggest you can ask WP7 question here. http://forums.create.msdn.com/forums/default.aspx?GroupID=19 You can get more helpful suggestions about access/obtain data in WP7.


    Larcolais Gong[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, July 13, 2011 9:52 AM
  • The point is actually I'm not asking that WP7 Mango supports edmx. In fact I have no intention neither to copy edmx nor deploy it to the WP7 device. I use edmx file only as a seed  for my own T4 code generation. So my problem is at Visual Studio level, not at WP7 development level, don't you agree?
    Wednesday, July 13, 2011 10:05 AM