Archives

Archives / 2010 / March
  • Some steps for moving WCF RIA Services Preveiw to the RC version.

    I moved the Aspen project from the WCF RIA Services VS2010 Preview to the RC version. Maybe some of you will move your Preview version to the RC, so I wrote down some steps..
     
     
    Server Side
     
    You can start with replacing the Web.Config, because I don’t know how your config looks like, I just copy a clean PDC preview config and paste it here and the new one for the RC
     

    Old one:
     
     
    <?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>
            <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>
     
     
    New one:
     
     

    <configuration>
      <configSections>
        <sectionGroup name="system.serviceModel">
          <section name="domainServices" type="System.ServiceModel.DomainServices.Hosting.DomainServicesSection, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" allowDefinition="MachineToApplication" requirePermission="false" />
        </sectionGroup>
      </configSections>
     
      <system.web>
        <httpModules>
          <add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, 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.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </modules>
      </system.webServer>
     
      <system.serviceModel>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
      </system.serviceModel>
     
     
    You can see all the changes by comparing both of them. I just made a simple copy and paste of the whole file in the Aspen project.
    On the server-side the following assembly references need to be replaced:
     
    Replace:
    System.Web.DomainServices
     
    To:
    System.ServiceModel.DomainServices.Server
     
    Located in the following folder (depends where your SDK is  installed):
    C:\Program Files\Microsoft SDKs\RIA Services\v1.0\Libraries\Server

    Then replace the System.Web.DomainServices namespace to System.ServiceModel.DomainServices.Server

    Replace the following assembly references:

    System.Web.Ria
    (and System.Web.Ria.Services)

    To:

    System.ServiceModel.DomainServices.Hosting
    System.ServiceModel.DomainServices.Server

    The EnableClientAttribute is located in the Hosting assembly now.

    Then replace the System.Web.Ria namespace to System.ServiceModel.DomainServices.Hosting.

    For the Invoke-, Insert,  IgnoreAttribute etc, replace the System.Web.Ria.Services namespace with System.ServiceModel.DomainServices.Server.
     
     
    Note: I don’t use LinqToEntitesDomainService, but I guess if you do, then you need on the server side add a reference to the assembly:
     
    System.ServiceModel.DomainServices.EntityFramework
     
    The LinqToEntitesDomainService is located in the following namespace: System.ServiceModel.DomainServices.EntityFramework
     
     
     
    Client-Side:
     
    Replace:

    System.Web.Ria

    To:

    System.ServiceModel.DomainServices.Client
    System.ServiceModel.DomainServices.Client.Web

    Located in the folder (depends where your SDK is installed):

    C:\Program Files\Microsoft SDKs\RIA Services\v1.0\Libraries\Silverlight

    Add a reference to the following assembly:

    System.ServiceModel.Web.Extensions

    (This assembly is not in the SDK folder; use the .NET Tab in the Add Ref. dialog)
    Remove the old “Generated_Code” folder and rebuild your solution.


    If you want to know when I publish a new blog post, you can follow me on twitter: http://www.twitter.com/fredrikn
     

    Read more...

  • WCF RIA Services Silverlight Business Application – Using ASP.NET SiteMap for Navigation

    Note: This blog post examples is based on the WCF RIA Services PDC Beta and WCF RIA Services VS 2010 Preview, changes to the framework may happen before it hits RTM.

    This blog post will be about using the ASP.NET SiteMap together with WCF RIA Services and the Navigation feature added to Silverlight. I assume you are familiar to how the Navigation feature will work when reading this blog post, even if you don’t know you may find this blog post interesting.

    Read more...