12/9/2013 Porting from WCF RIA Services to Open RIA Services

Other articles by:ColinBlair Colin Blair

All Open RIA Services components are installed from NuGet packages. Those packages are currently available from a MyGet feed. You can add the MyGet feed in Visual Studio on the Tools->Library Package Manager->Package Manager Settings->Package Sources screen. The URL is https://www.myget.org/F/openriaservices/

UPDATE: Open RIA Services has been released, NuGet packages are now available from NuGet,

  1. Remove all WCF RIA Services NuGet packages and DLLs. Look for DLLs with the System.ServiceModel.DomainServices and Microsoft.ServiceModel.DomainServices namespaces.
  2. Install the OpenRiaServices.Server package for all project that previously referenced System.ServiceModel.DomainServices.Server
  3. If you are using Entity Framework 6, install the OpenRiaServics.EntityFramework package.
  4. If you are using Entity Framework 4 (ObjectContext), install the OpenRiaServices.EntityFramework.EF4 package.
  5. If you are using Entity Framework 5, you will need to upgrade to 6.
  6. Install the OpenRiaServices.Silverlight package in the Silverlight projects that previously had the System.ServiceModel.DomainServices.Client DLL.
  7. The OpenRiaServices.Silverlight package includes the OpenRiaServices.Silverlight.Core, OpenRiaServices.Silverlight.CodeGen, and OpenRiaServices.ViewModel packages in one install.
  8. Unload the Silverlight project and edit the project file.
  9. Find the LinkedServerProject tag inside the project file. Rename the tag to LinkedOpenRiaServerProject and then reload the project. Repeat for any other projects that are RIA Linked.
  10. Added 4/14: If you are using the RiaClientUseFullTypesNames in the project file, rename it to OpenRiaClientUsefullTypesNames.
  11. Find all references to the System.ServiceModel.DomainServices namespace in your solution and replace them with OpenRiaServices.DomainServices.
  12. In the web.config, the PublicKeyToken for the RIA Services dlls needs to be changed to null in addition to changing form System.ServiceModel.DomainServices to OpenRiaServices.DomainServices
  13. If you are using the DomainDataSource, then remove the System.Windows.Controls.DomainServices dll and install the OpenRiaServices.Silverlight.DomainDataSource package. The namespace changes match the dll changes.

Breaking Changes

  • DbDomainService does not support older version of Entity Framework.
  • Open RIA Services dlls are not strongly signed.
  • Open RIA Services does not support partial trust.

Rated 3.67, 3 vote(s). 




Hello Colin,

We're porting our projects from WCF RIA Services and EF4 to Open RIA Services and EF61. We're getting the following stacktrace. Any hints?

[MissingMethodException: Cannot create an abstract class.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +113
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +232
System.Activator.CreateInstance(Type type, Boolean nonPublic) +83
System.Activator.CreateInstance(Type type) +6
OpenRiaServices.DomainServices.Hosting.DomainServiceHost.CreateEndpointFactoryInstance(ProviderSettings provider) +34
OpenRiaServices.DomainServices.Hosting.DomainServiceHost.CreateDescription(IDictionary`2& implementedContracts) +634
System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +146
System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses) +46
OpenRiaServices.DomainServices.Hosting.DomainServiceHost..ctor(Type domainServiceType, Uri[] baseAddresses) +281
OpenRiaServices.DomainServices.Hosting.DomainServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) +29
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +494
System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +1434
System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +52
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +598
[ServiceActivationException: The service '/WEB/Services/Company-Security-DomainServices-AuthenticationService.svc' cannot be activated due to an exception during compilation. The exception message is: Cannot create an abstract class..]
System.Runtime.AsyncResult.End(IAsyncResult result) +494824
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +178
System.ServiceModel.Activation.ServiceHttpHandler.EndProcessRequest(IAsyncResult result) +6
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +129

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18449

6/11/2014 7:43:59 PM

Colin Blair


That error indicates that one of the endpoints configured in your web.config is having problems. Take a look in your web.config and see if you have a section with RIA Services end points. There is probably something incorrect there, perhaps you have one still referencing WCF RIA Services?

6/11/2014 8:14:12 PM


Thanks, removing an obsolete SOAP end point config did the trick! Colin, you are the best.

6/12/2014 8:55:50 AM

Pedro Ferreira

Hi Colin,

We're migrating our project from WCF RIA Services and EF5 to Open RIA Services and EF61. I'm having the following error in all of my domain services:

'AttachAsModified' is not a member of 'System.Data.Entity.Core.Objects.ObjectSet(Of BAnesthesic.RIAServicesLibrary.Web.xxxxx)'.

6/16/2014 2:52:13 PM

Colin Blair

@Pedro AttachAsModified is an extension method provided by RIA Services. Add this to your file:

using OpenRiaServices.DomainServices.EntityFramework.ObjectContextExtensions;

6/16/2014 3:18:39 PM

Pedro Ferreira

Thanks Colin, amazing work and support. Everything seems to be working now.

6/17/2014 11:03:48 AM



I am having some problem while upgrading EF4 to EF6.

I am done with every steps which are basically posted on your blog expect one.

When i am trying to replace LinqToEntitiesDomainService<ExamModelContainer> with DomainService, i am getting error of metadata file could not be found and the type or namespace name "Entity" could not be found.

Can you tell me how to what will be replace of LinqToEntitiesDomainService for providing ObjectContext?

If I keep LinqToEntitiesDomainService I get this error "Exception has been thrown by target of an invocation"

Thanks in Advance...

6/17/2014 11:38:29 AM

Colin Blair

@Paritosh You should continue to use LinqToEntitiesDomainService which is in the OpenRIaServices.EntityFramework NuGet package. When are you getting that exception? During runtime or compile time?

6/17/2014 1:55:57 PM


Hi colin,

I am getting this during Compile time.

6/17/2014 2:05:07 PM

Colin Blair

@Paritosh Please move your question to the message forum as it is easier to keep track of your question that way. In the meantime.

Please post the section of the compile output that is showing the error in the message forum. In the meantime, my best guess is that either you have some WCF RIA Services dlls still in your references or web.config and/or problems with the EF configuration in your web.config. If your DomainService is not in the main web project, for example you are using a RIA Services Class Library, then you need to make sure that the web.config in the project library is also setup.

6/17/2014 2:18:41 PM
1 2 3 4 5
Notify me when new comments are added to this post
Save comment