Deploying Silverlight 4 WCF Ria Services Application

Problems Deploying a Silverlight 4 application using WCF Ria Services on a  Windows Home Server (IIS 6)

This is not a comprehensive Todo post.  Just notes on what it took to get it going…

Well, that turned into a two weekend Time Sink.  So, the deployment of the SL RIA services web project is pretty straight forward from Visual Studio 2010.  Once copied up, the application was easy to get running, however getting Data connectivity through RIA Services was a different story.  These problems are just not debuggable without using Fiddler.

So, the application ran, but showed no data.  Fiddler was showing a 404 error accessing .svc queries.  That was first, because the .svc extension wasn’t mapped to aspnet_isapi.dll, and then because I hadn’t unchecked the “Verify that file exists” option.  After that, I the server started returning error 500 because I hadn’t allowed execute access to the subdirectories…

A number of individual things needed to be set just so in order for everything to work.  Many were obvious to me and some were not.   Figuring out what mattered and what didn’t for my application was really a chore.

  • The Virtual Directory needed execute permissions on Scripts and Executables set.  It is important that this extend to the bin, clientbin and aspnet_client folders as well.
  • The Application Extension Mappings needed “.svc” mapped to “C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll” and the “Verify that file exists” option must be UNCHECKED because this Ria Services uses dynamic service file, so it really doesn’t exist.  Also ensure that “All Verbs” are enabled.
  • Obviously make sure that the default content page is appropriate in the “Documents” tab if you don’t want people having to type in your start page name.
  • In “Directory Security”, I enabled anonymous access and disabled everything else.  Need to revisit whether integrated windows authentication can be turned on in this case instead of anonymous access.
  • In the “ASP.NET” tab, make sure that the correct .NET framework version is selected.  I also removed all the connection strings except the one I wanted RIA services to use.  This shouldn’t matter as connection strings should be used by name anyway.
  • In the “HTTP Headers” tab, you need to add the following MIME types:
    • .xaml  ->  application/xaml+xml
    • .xap -> application/x-silverlight-app
    • .xbap -> application/x-ms-xbap
  • I also enabled Immediate Content Expiration in the “HTTP Headers” tab, but I don’t think I really needed or want this in the final deployment. 

Don’t forget the IISRESET to ensure that all these settings are active.

This entry was posted in Computer Stuff, Programming, Windows Home Server. Bookmark the permalink.