Open RIA Services User Support The type or namespace name 'WebContextBase' could not be found (are you missing a using directive or an assembly reference?)  Viewed 23104 time(s), 4 post(s)., 12/23/2014 3:31:25 PM - by Frank

Frank
Frank 12/23/2014 3:31:26 PM

Hello.

I tried to move from EF5 + WCF RIA Services to EF6.0.1 + Open RIA Services.

1°/ But in the Silverlight project I could not change the namespaces by hand because it is automatically generated (I don't know i which way : no documentation). What happens behind the scenes ?
These are the original namespaces.

using System.ServiceModel.DomainServices;
using System.ServiceModel.DomainServices.Client;
using System.ServiceModel.DomainServices.Client.ApplicationServices;

I would like to turn them to

using OpenRiaServices.DomainServicess;
using OpenRiaServices.DomainServices;
using OpenRiaServices.DomainServices.Client.ApplicationServices;

2°/ I managed to compile the server side project. (BTW, I used the domain service wizard to create my domain service class with WCF RIA services libraries but I switched to Open RIA Services and now I can't use the wizard anymore). So I changed the namespaces manually in the domain service file. I can't find any explanation to this behaviour (no documentation). Again, what happens behind the scenes ?

3°/ Is there any clear documentation about each package available (about Open RIA Services) on Nuget because sometimes packages' names are quite confusing.

Any help would be much appreciated.
Thank you.

This content has not been rated yet. 
25 Reputation 3 Total posts
1
ColinBlair
ColinBlair 12/26/2014 3:01:26 PM

1) If you follow the porting instructions located at http://www.openriaservices.net/blog/post/The-Open-RIA-Services-Blog/1017/Porting-from-WCF-RIA-Services-to-Open-RIA-Services/ that should lead you to a working project.
2) If you are using Visual Studio 2013 and have installed the Open RIA Services Tooling from the Visual Studio Gallery (https://visualstudiogallery.msdn.microsoft.com/1c7b3c91-4e43-4c30-992e-00c67f80b2c9) then you will have the Domain Service Wizard back.
3) Each package has a description explaining what it is for. Probably the most confusing aspect is the new Signed versions of the packages which were provided for the use of Telerik and other organizations and users that require strongly named assemblies. For the most part, the only three packages you need to worry about are:

Server
    OpenRiaServices.Server
    OpenRiaServices.EntityFramework
Client
    OpenRiaServices.Silverlight

This content has not been rated yet. 
1539 Reputation 130 Total posts
2
Frank
Frank 12/30/2014 5:12:59 PM

1°/ After many tries (installs / uninstalls) it finally worked with a new project. It seems that there were some packages missing (MySQL.Data & MySQL.Data.Entity) which were not needed before.

But I was not able to use the Domain Service wizard (empty list). I use Visual Studio 2012.
So I had to implement the Domain Context class by myself. Although, I don't know how to implement the update methods with a DbDomainService.

2°/ Well, I managed to convert my current project too which uses LinqToEntitiesDomainService and ObjectContext but I have the following error.

Error   30  Instance argument: cannot convert from 'System.Data.Entity.Core.Objects.ObjectSet<Stock.Web.product>' to 'System.Data.Entity.DbSet<Stock.Web.product>'   C:\Users\Frank\Documents\Visual Studio 2012\Projects\Stock\Stock.Web\Services\StockDomainService.cs 1061    13  StockC2L.Web

with the following code
this.ObjectContext.product.AttachAsModified(currentproduct, this.ChangeSet.GetOriginal(currentproduct));

If I could make the wizard work I would not have to implement it by myself and I could generate the update methods. But I would appreciate it if I had not to write hundreds of decoration annotations too. Maybe there is only one directive missing somewhere else.

Note : when StockDomainService inherits from System.ServiceModel.DomainServices.EntityFramework.LinqToEntitiesDomainService the wizard works but not when it inherits from OpenRiaServices.DomainServices.EntityFramework.LinqToEntitiesDomainService.

This content has not been rated yet. 
25 Reputation 3 Total posts
3
Frank
Frank 12/31/2014 8:27:11 AM

I finally figured it out. I didn't see one of your comments mentioning it at http://www.openriaservices.net/blog/post/The-Open-RIA-Services-Blog/1017/Porting-from-WCF-RIA-Services-to-Open-RIA-Services/?blogcommentspageno=2

I have to insert the following using directive.

using OpenRiaServices.DomainServices.EntityFramework.ObjectContextExtensions;

Now, I have to find a way to fix the wizard for futur Domain Services ...

This content has not been rated yet. 
25 Reputation 3 Total posts
4