As of now, you might know that, Silverlight 5 RC (Release Candidate) has been released by Microsoft on 1st September 2011. If you are not aware of that, or if you didn't yet download the latest bits of Silverlight 5, visit "Silverlight 5 Release Candidate is now Available - Download Silverlight 5 RC" to know about this release as well as download the installer to start developing your applications.

 

So, what's new in this release of Silverlight 5? There are many but in this post, we will discuss about some changes in the Application settings for Elevated Trust for Out-of-Browser and In-Browser applications. What's that? Read more to know about this.

 

Background

This article is based on Silverlight 5 RC. If you didn't install the latest RC bits, download them from "Download Silverlight 5 RC".

 

You may probably know that, Silverlight 5 now supports local resource access inside browser itself. Silverlight team now did some changes in the application settings page to enable the elevated trust settings for both out-of-browser and inside-browser applications.

 

In this post we will learn how to enable those settings for your Silverlight applications. If you open the application settings page, you will see the below:

 

Silverlight 5 OOB Settings Demo - Out-of-Browser and Inside-Browser

 

In the settings page, navigate to the "Silverlight" tab. There you will find options for both the choice as shown in the above screenshot. If you want to enable elevated trust for out-of-browser, you have to first enable the OOB settings as you did in earlier versions too.

 

If you enable Out-of-Browser settings, you will see a file named "OutOfBrowserSettings.xml" in the properties folder and if you enable In-Browser settings, you will see a file named called "InBrowserSettings.xml" in the properties folder as shown below:

 

Silverlight 5 OOB Settings Demo - Settings.xml for both Out-of-Browser and In-Browser

 

You can enable both of them, you will see both the files in the properties folder. Let's discuss these in depth.

 

Out-of-Browser Settings

Enabling out-of-browser and elevated trust for that is not a new thing. You can check the "Enable running application out of the browser" to enable the same. If you want to enable the elevated trust for that, you need to click the "Out-of-Browser Settings..." button. This will open up the settings page. As shown below, check the "Require elevated trust when running outside the browser" checkbox to enable that. Click "OK" to save it.

 

Silverlight 5 OOB Settings Demo - Elevated Trust running Out-of-Browser

 

Once you complete doing the above steps, you will find the content of "OutOfBrowserSettings.xml" modified as below:

 
<OutOfBrowserSettings ShortName="APPLICATION_NAME" 
                      EnableGPUAcceleration="False" 
                      ShowInstallMenuItem="True">
    <OutOfBrowserSettings.Blurb>APPLICATION_DESCRIPTION</OutOfBrowserSettings.Blurb>
    <OutOfBrowserSettings.WindowSettings>
        <WindowSettings Title="APPLICATION_TITLE" />
    </OutOfBrowserSettings.WindowSettings>
    <OutOfBrowserSettings.SecuritySettings>
        <SecuritySettings ElevatedPermissions="Required" />
    </OutOfBrowserSettings.SecuritySettings>
    <OutOfBrowserSettings.Icons />
</OutOfBrowserSettings>

 

 

In-Browser Settings

If you want to enable the elevated trust for your in-browser applications, no need to do more than the below settings change. In the application settings page, they introduced another checkbox called "Require elevated trust when running in-browser".

 

Check the below screenshot for reference:

 

Silverlight 5 OOB Settings Demo - Elevated Trust running Inside-Browser

 

This will modify the content of "InBrowserSettings.xml" file as mentioned in the below code snippet:

 
<InBrowserSettings>
    <InBrowserSettings.SecuritySettings>
        <SecuritySettings ElevatedPermissions="Required" />
    </InBrowserSettings.SecuritySettings>
</InBrowserSettings>

 

Hope this information is helpful for you to understand the new changes in Silverlight 5 RC. Enjoy reading my other posts on the same topic. Don't forget to share my Silverlight 5 Tutorials to others. This will help them to understand the topics very easily. If you have any queries or feedback, just drop a line below. I will try to answer you as early as possible.

Have a question? Or, a comment? Let's Discuss it below...

dhgate

Thank you for visiting our website!

We value your engagement and would love to hear your thoughts. Don't forget to leave a comment below to share your feedback, opinions, or questions.

We believe in fostering an interactive and inclusive community, and your comments play a crucial role in creating that environment.