When you deploy a Silverlight application that uses an ADO.NET data service to a hosted service provider, you need to make some changes in order for the service to work properly. The following describes the steps I took to overcome the problems. Thanks to Phani Raj Yayavaram Narasimha, Mike Flasko, and Elisa Flasko at Microsoft for their help resolving these issues.
Modify Web.config in the Silverlight web application
Since the hosted server supports many different sites, it is necessary to tell your application which site is hosting your application. If you fail to do this, you will get an error similar to the following:
This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
To do this, you need to add a “<baseAddressPrefixFilters>” element to the “<serviceHostingEnvironment>”. The highlighted text shows an example.
Modify the Service Reference in the Silverlight Code
You also need to change the service reference inside your Silverlight code to point to the service with an absolute address. Following is a sample that I used in my application:
Defining a Single Authentication Scheme
Your site must have one and only one authentication scheme. If you have more than one authentication scheme defined, you will get an error similar to the following:
IIS specified authentication schemes 'Basic, Anonymous', but the binding only supports specification of exactly one authentication scheme. Valid authentication schemes are Digest, Negotiate, NTLM, Basic, or Anonymous. Change the IIS settings so that only a single authentication scheme is used.
I reduced my site’s authentication to “Anonymous” and everything worked great. The exact details on how you do this vary from ISP to ISP. I use DiscountASP.NET and I used the IIS MMC on the IIS 7 server hosting my site. You need to check with your ISP to determine how to do this on their hosting site.
Microsoft is at it again releasing a number of upgraded technologies in a very short period of time. At PDC 09 I am seeing a new release of MVC (MVC 2 beta), Silverlight 4 (developer preview), and two versions of RIA Services (WCF RIA Beta for VS 2008 and WCF RIA Preview for VS 2010 beta). This is on top of the recent release of beta 2 of VS 2010. I have spent most of today trying to understand the new releases and trying to decide which one I’d start to play with.
I have decided that my first area of study will be WCF RIA Services Preview for VS 2010. After talking with some of the RIA team, I decided that although the “preview” is less stable than the “beta”, the functionality that it has is more interesting. Be aware that the two releases (the beta for VS 2008 and the preview for VS 2010) do not share identical sets of functionality.
I have had a chance (under NDA) to already take a look at some of the really neat new stuff like Inheritance, Compositional Hierarchy, the Presentation Model, Drag and Drop support, and improved live Intellisense. All these new features are available in the preview available for VS 2010 so that’s where I am going to focus.
I am retired and can do anything I want with my time I cannot imagine how someone with a full-time job has time to keep up with all the new stuff. Hopefully you’ll find the videos I create that share what I learn an effective way to at least get a sense for what’s happening.
Microsoft just announced a new release of RIA (Data) Services. As the name implies, the new release (the first beta) now uses WCF as its underlying data transport protocol.
I posted a tutorial, Silverlight LOB Data Strategies, that compared RIA Services with IdeaBlade’s DevForce Silverlight and ADO.NET Data Services from Microsoft. In that tutorial, I compared the “size” of the data package downloaded to the client using each technology. RIA Services did not do well on this metric.
Shortly after posting the results, I heard from Deepesh Mohnani, a Product Manager on the RIA team, who let me know that his team was doing work to improve the download package size. It turns out that the incorporation of WCF was the basis of the improvement.
About a month ago I was given a preview of the new bits and ran my test again using the WCF technology. The size of the download package went from 2.2 MB with the July Preview down to 0.72 MB with the WCF technology. My download package included some binary images and WCF handles this type of data much better.
With the incorporation of WCF as the data transport technology, RIA Services moved from producing the largest package size to producing the smallest package size (0.72 MB versus 1.01 MB for DevForce Silverlight and 1.2 MB for ADO.NET Data Services).
I’ll be experimenting with the new beta release and likely post a video or two talking about the improvements.
I have published a new video that covers Silverlight 3 and Visual Studio/Visual Basic 10. The tutorial shows you how to build an application using the "digg.com" API and web service. It is an updated version of an application Scott Guthrie published when Silverlight 2 was introduced but has been updated to take advantage of Silverlight 3 features such as Child Windows. It also demonstrates use of the new Cider visual Xaml editor available in VS 2010. This is a much-improved editor (compared to the almost useless version in VS 2008) although I still prefer working with the Xaml directly.
In addition, I show some of the new features available with VB 2010 including implicit line continuation and auto-generated properties. I also show one of my favorite tricks using XML schemas to enhance Intellisense when writing LINQ queries over XML.