These are the steps I had to go through to migrate a Silverlight application that was running on the .NET RIA Services preview released in July 09, to the new WCF RIA Services released during PDC 09:

  1. Delete all HttpHandler references to DataService.axd from your web.config. Basically, these two need to go:
    <system.webServer>
      ...
      <handlers>
        ...
        <add name="DataService" verb="GET,POST" path="DataService.axd" type="System.Web.Ria.DataServiceFactory, System.Web.Ria, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </handlers>
    </system.webServer>
    <httpHandlers>
      ...
      <add path="DataService.axd" verb="GET,POST" type="System.Web.Ria.DataServiceFactory, System.Web.Ria, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
    </httpHandlers>
  2. Add/update your web.config along the lines of:

    .NET 3.5:

    <?xml version="1.0"?>
    <configuration>
      <system.web>
        <httpModules>
          <add name="DomainServiceModule" type="System.Web.Ria.Services.DomainServiceHttpModule, System.Web.Ria,Version=2.0.0.0,Culture=neutral,PublicKeyToken=31BF3856AD364E35"/>
        </httpModules>
      </system.web>
      <system.webServer>
        <modules>
          <add name="DomainServiceModule" preCondition="managedHandler" type="System.Web.Ria.Services.DomainServiceHttpModule, System.Web.Ria,Version=2.0.0.0,Culture=neutral,PublicKeyToken=31BF3856AD364E35"/>
        </modules>
      <system.webServer>
      <system.serviceModel>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
      </system.serviceModel>
    </configuration>

    .NET 4.0:

    <?xml version="1.0"?>
    <configuration>
    
      <system.web>
        <httpModules>
          <add name="DomainServiceModule" type="System.Web.Ria.Services.DomainServiceHttpModule, System.Web.Ria, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </httpModules>
        <compilation debug="true" targetFramework="4.0" />
      </system.web>
    
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules runAllManagedModulesForAllRequests="true">
          <add name="DomainServiceModule" preCondition="managedHandler"
              type="System.Web.Ria.Services.DomainServiceHttpModule, System.Web.Ria, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </modules>
        <validation validateIntegratedModeConfiguration="false" />
      </system.webServer>
    
      <system.serviceModel>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
      </system.serviceModel>
    </configuration>
  3. If you’re throwing DomainServiceException, take note that the class has been renamed to DomainException. Update your code accordingly.
  4. Remove any reference you may have to System.Web.DomainServices.Providers.dll, you will need to add a new reference to either System.Web.DomainServices.EntityFramework.dll or System.Web.DomainServices.LinqToSql.dll depending on what you use.
  5. Change this:
    using System.Web.DomainServices.LinqToEntities;

    To this:

    using System.Web.DomainServices.Providers;

    Everywhere.

  6. The DomainService.Context property has been renamed to ObjectContext. Update all your code accordingly.

     

    Now, your Web application should build, but you may still get this error while building the actual Silverlight application:

    Error    5    The "CreateRiaClientFilesTask" task failed unexpectedly.
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: The AutoGenerateField property has not been set.  Use the GetAutoGenerateField method to get the value.
       at System.ComponentModel.DataAnnotations.DisplayAttribute.get_AutoGenerateField()

    In my case, this was a problem with the System.ComponentModel.DataAnnotations.dll reference. Remove it and re-add it from the Global Assembly Cache.

  7. Remove the reference to System.Windows.Ria.Controls.dll and add one to System.Windows.Controls.Ria.dll.
  8. You will need to update your XAML to reference the new assembly:

    Replace System.Windows.Ria.Controls with System.Windows.Controls.Ria in your namespace declarations in the header of the XAML file. Here’s how the old ones look:

    xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Ria.Controls" xmlns:System_Windows_Data="clr-namespace:System.Windows.Data;assembly=System.Windows.Ria.Controls"
  9. RiaContext (.Current) has been renamed to WebContextBase. It’s in the System.Windows.Ria namespace.
  10. The System.Windows.Ria.Data namespace has been removed. So make sure to remove it from your usings also.
  11. RiaContext.Current.User is now WebContextBase.Current.Authentication.User
  12. In XAML, the namespace for the ControlParameter type has changed to System.Windows.Controls from System.Windows.Data, update accordingly.
  13. If you use Forms Authentication, update the RiaContext reference in App.xaml to a WebContext reference such as:
    <Application.ApplicationLifetimeObjects>
        <app:WebContext>
            <app:WebContext.Authentication>
                <appsvc:FormsAuthentication/>
                <!--<appsvc:WindowsAuthentication/>-->
            </app:WebContext.Authentication>
        </app:WebContext>
    </Application.ApplicationLifetimeObjects>

With some luck, your project should be migrated to WCF RIA Services now. These were the steps I needed to get mine working.

Additional breaking changes in the new release can be found here.

Good luck!