Click here to Skip to main content
13,345,438 members (48,384 online)
Click here to Skip to main content
Add your own
alternative version


16 bookmarked
Posted 6 Nov 2009

Silverlight 3 Out Of Browser Feature

Rate this:
Please Sign up or sign in to vote.
Here I will explain the feature & step by step process for implementing the Silverlight Out-Of-Browser functionality.


Silverlight 3 came up with Out Of Browser support. Using that feature, one can install the application just like a standalone Windows application. Hence there is no need to open the browser to run the Silverlight application. Today for the first time, I went through the APIs & created a sample application. Here I will discuss about the same to give you a demonstration. It is quite easy to implement.

Create a Silverlight application using Visual Studio 2008. This will automatically create “MainPage.xaml”. Now open the MainPage.xaml and add the following lines inside the LayoutRoot Grid:

<StackPanel Margin="20" HorizontalAlignment="Center">
    <TextBlock Text="Silverlight Out Of Browser Demo Application" FontSize="20" 

    <Button x:Name="btnInstall" Content="Install as Out Of Browser Application" 

	Width="300" Height="20" Margin="20"/>

Run your application to check whether your Silverlight application is working or not. Now if you click on the button, there will be no effect as we didn't write the code for it. Hence go for it. Open the code behind file “MainPage.xaml.cs” and register the button event. Inside the button event, write the below code:


Run your application and click the Install button. You will come across Catastrophic Failure exception. Yes, right. This is because you didn't mark the application as Out of Browser application. You have to explicitly tell it to be installed as out of browser. To do this, right click on your Silverlight project and go to properties. Enable the check box titled “Enable running application out of browser”.


Click on the button named “Out-of-Browser Settings…”. Here you can provide the title, size & icon for the install application. Now run your Silverlight application & right click on the page. You will find a new menu coming on the Silverlight context menu to install it as OOB (Out-Of-Browser). You can use the same menu item to install it. This will do the steps automatically. This comes automatically if your application supports the same. Here, we wrote our own code so that if we click on the button, it will install. Hence, click on the button. This will show you a popup to install the application in your PC. If you go ahead, this will install it on desktop and start menu. If successfully installed, it will open the same as a standalone application. Close everything and go to the desktop. Open the installed application from the shortcut it generated. You will find that exact application is now available as a desktop application.


  • 6th November, 2009: Initial post


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Kunal Chowdhury «IN»
Software Developer (Senior)
India India
Kunal Chowdhury is a Microsoft "Windows Platform Development" MVP (Most Valuable Professional), a Codeproject Mentor, Telerik Developer Expert, Nokia Developer Champion, Windows 10 Champion, Microsoft Rockstar, Speaker in various Microsoft events, Author, passionate Blogger and a Software Engineer by profession.

He is currently working in an MNC located in India. He has a very good skill over XAML, C#, Silverlight, Windows Phone, WPF and Windows Store (WinRT) app development. He posts his findings, articles, tutorials in his technical blog and CodeProject.

Book authored:

Connect with me on:

My CodeProject Awards/Prizes:

You may also be interested in...


Comments and Discussions

GeneralGood info, but it can be found elseware Pin
gaurav_verma_mca6-Nov-09 5:40
membergaurav_verma_mca6-Nov-09 5:40 
GeneralRe: Good info, but it can be found elseware Pin
KunalChowdhury15-Feb-10 20:14
memberKunalChowdhury15-Feb-10 20:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.180111.1 | Last Updated 6 Nov 2009
Article Copyright 2009 by Kunal Chowdhury «IN»
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid