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.