I just updated the Silverlight 5 examples in for the book with the released version, and overall it went smoothly, however there are some changes for one of the examples, which I’ll explain in this posting. The new download is available here for your development pleasure.
For most of the examples, all I had to do was uninstall the Release Candidate and install the released version, and it just worked. However the Chapter 11a example, which requires running in the browser with elevated trust, changed a little. This example demonstrates how to use the WebBrowser control in a solution; in this case it shows a preview of an article from an RSS feed. This requires the elevated trust, and the process for that has changed a little.
To allow trust in the Release Candidate, you needed to specify an out-of-browser application. The released version includes a special checkbox for in-browser trust, labelled “Require elevated trust when running in-browser,” as shown below. There may have been other changes under the covers, as I found that checking the box on the RC version wasn’t enough and left me with a corrupted project file. Therefore I made a new project file, which is now in the code download.
To run with elevated trust, your assembly also needs to be signed with a digital certificate, and the certificate needs to be trusted by your client. If you’re doing this in a production envrionment, you’ll ideally want to choose a certificate that your client already trusts, such as one from your Active Directory environment. In this case, however, I just used a test certificate. Fortunately, Visual Studio 2010 makes that really easy!
The figure below shows the Signing tab in the Silverlight project. The first step is to check the “Sign the Xap File” checkbox. Next, you need to select or create a digitial certificate which includes a public key. I simply clicked, “Create Test Certificate” to generate a test cert for development.