WCF RIA Silverlight deployment issues

deploymentriasilverlightwcf

It seems the world is awash with people having problems deploying RIA WCF services, and now I'm one too. I've already tried a bunch of things, but to no avail. I need WCF RIA to support a Silverlight 3 application I've built.

The short story is, using the new WCF RIA services (Nov 09?) I open VS 2008, create new project (silverlight application), enabling ".NET RIA services". Add new item to web project – Linq2SQL dbml file (from SQL 2005 DB prepared earlier) and compile. I add a new item to the web project – domain service (link the tables I need) and compiled. Using the domain context I "Load" data with a standard RIA get query in the MainPage and add a TextBlock to display returned data. Build & run (cassini) – success. Using VS to publish to IIS on local PC – success.

Using VS to publish to test server (IIS6) – browse to location and the Silverlight app loads but Fiddler tells me I've got a 404 on all the the WCF .svc requests. Use Fiddler to "launch IE" on the service request and it's true – 404.

I have already run aspnet_regiis, ServiceModelReg and added mime types for .xap, .xaml, .xbap and .svc. I have included the System.Web.Ria and System.Web.DomainServices DLL with copy local true.

I need help with either

a) a solution

b) an approach to find a solution

Best Answer

I had some troubles with this also, although once I figured them out it's relatively straight forward.

First, run through http://timheuer.com/blog/archive/2009/12/10/tips-to-deploy-ria-services-troubleshoot.aspx (although it seems you have most of that covered off).

Check that you have your DomainServiceModule in the web.config in the new system.webServer bit and the old bit for IIS6:

    <httpModules>
   <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
   <add name="DomainServiceModule" type="System.Web.Ria.Services.DomainServiceHttpModule, System.Web.Ria, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  </httpModules>

Finally, I had to create my services manually, by creating .svc files where SL is looking for them (from fiddler) and filling them in with:

<%@ ServiceHost Service="NameOfSerice" Factory="System.Web.Ria.DomainServiceHostFactoryEx" %>

Make sure that you also visit the .svc file directly (without the /binary on the end) as you can get some nice errors there (well once you solve your 404 of course!)

HTH,

Jordan.

Related Topic