Print Page | Close Window

DF EDM not seen in Domain Service Class

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2441
Printed Date: 29-Jul-2026 at 1:07pm


Topic: DF EDM not seen in Domain Service Class
Posted By: tscheffel
Subject: DF EDM not seen in Domain Service Class
Date 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.
 



Replies:
Posted By: kimj
Date 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. 


Posted By: tscheffel
Date 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.


Posted By: kimj
Date 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.


Posted By: tscheffel
Date 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.
 
 



Print Page | Close Window