New Posts New Posts RSS Feed: DF EDM not seen in Domain Service Class
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

DF EDM not seen in Domain Service Class

 Post Reply Post Reply
Author
tscheffel View Drop Down
Newbie
Newbie
Avatar

Joined: 14-Jan-2011
Location: IL
Posts: 3
Post Options Post Options   Quote tscheffel Quote  Post ReplyReply Direct Link To This Post Topic: DF EDM not seen in Domain Service Class
    Posted: 14-Jan-2011 at 6:28pm
I am using DevForce Universal 6.0.7 Express via VS2010 Pro on a WIN XP Pro machine in order to reevaluate Silverlight (I looked at version 2 and quickly ran away) and also to weigh using DF vs. RIA Services.  I've gone through quite a few tutorials, both standard SL and DF SL.

Now the problem: When I create a new (non-DF) Silverlight 4 Business Application project in VS2010 and add an ADO.Net Entity Data Model to the web project, the project template adds 3 IdeaBlade DLLs to the web and SL projects (plus the .tt and other files).  When I then try to add a Domain Service Class to the web project, the wizard is unable to see the newly-created entities (I've built the solution and even rebooted/restarted VS, per Googled suggestions).

Thus my questions:
1) How do I add a plain old (non-DevForce/IdeaBlade) ADO.Net EDM to my project via VS2010?
2) Even with the (DF/IB) EDM added to the project, why is the Domain Service Class wizard unable to see the entities? Does the EDM being DF-related affect its visibility to the DSC wizard?  I assume not--I'm probably just making a non-obvious stupid mistake or I'm mixing apples with oranges.
 
Since the EDM template seems to have been hijacked by DF/IB, I'm posting the query here.  Thanks for your time and attention.
 
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 15-Jan-2011 at 5:16pm
The DevForce OM Designer Extension is what's causing your EDM to be generated as a DevForce model.  You can turn it off in two ways:  1) disable the extension in VS - go to Tools | Extension Manager, then select the extension and hit the disable button, or 2) set the "DevForce Enabled" flag to false in the EDM Properties window shown when the designer is open and the model itself is selected.
 
The Domain Service wizard is looking for an EF Object Context (or Linq to SQL DataContext).  When the model is generated by DevForce there's only the DF EntityManager, which RIA doesn't recognize. 
Back to Top
tscheffel View Drop Down
Newbie
Newbie
Avatar

Joined: 14-Jan-2011
Location: IL
Posts: 3
Post Options Post Options   Quote tscheffel Quote  Post ReplyReply Direct Link To This Post Posted: 15-Jan-2011 at 6:42pm
First, many thanks for your informative reply!
 
Regarding option (1) - Disabling IB OM DE via the Extension Manager does the trick, albeit requiring a VS restart.
 
Regarding option (2) - When I set the EDM's DevForce Enabled property to False, I can indeed add a Domain Service Class that sees the EDM.  However, when I recompile the app I receive an error: [Source file 'C:\...\Models\Model1.IB.Designer.cs' could not be opened ('Unspecified error ')].  This error happens whether or not I add the Domain Service Class. When I set it back to True (and delete the DSC, if added) & recompile, no error is encountered (but then I can't add a DSC).  Any thoughts?
 
A question you probably can't answer is why the heck didn't they just add a "DevForce EDM" template instead of hijacking the existing ADO.Net EDM template?  This would be akin to adding other custom DevForce templates, e.g. DevForce Silverlight Application.
 
Again, thanks for your reply.
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 15-Jan-2011 at 6:58pm
You're getting that error because the Silverlight project is still trying to link to the Model1.IB.Designer.cs file, which no longer exists.   We don't do cleanup of links when the file is removed (and maybe we should ...).  If you remove the file from the SL project that will fix the error.
 
Why did we not add a DevForce EDM template?  Well, we like all the wizardry of the Add Entity Model wizard and EDM designer.   DevForce "enabled" means we add several additional properties and custom code generation, but we still rely on all the features built into EF.  Could we hijack their template and provide a customized DevForce EDM project item template?  Possibly.  It's an interesting idea and might be something worth looking into.
Back to Top
tscheffel View Drop Down
Newbie
Newbie
Avatar

Joined: 14-Jan-2011
Location: IL
Posts: 3
Post Options Post Options   Quote tscheffel Quote  Post ReplyReply Direct Link To This Post Posted: 15-Jan-2011 at 7:37pm
Thanks again for the fast & informative reply.  Deleting the file link did indeed solve the problem.
 
I agree that DF should clean up the link when DF removes the file as part of good garbage collection (how this hasn't been previously identified as a problem puzzles me).
 
Finally, I vote for the future enhancement that DF should add a custom DevForce Entity Data Model item template instead of quietly modifying the existing VS template.  Thus, any templates that DevForce adds/modifies should clearly be labeled as DevForce XXX, in my humble opinion.  This will help prevent confusion and let we developers know what DF has messed with.
 
Thanks & take care.
 
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down