Silverlight 3 allows Silverlight web applications to be saved on the desktop and can run offline. The application can be added to the end user's Start menu and Desktop, based on the user's preference. One major benefit is that the end user can run the application at home, at work, and on the go without the need of a web browser and online access. This is limited for applications that require online access for web services and data access. For those scenarios, you can still run the application on the computer, but will still need to be connected online to get access to the data.
In this tutorial, we will show you how to rapidly configure your applications to be run offline.
Offline is easy as 1-2-3
Configuring the Silverlight application to run offline takes less than a few minutes with the following steps.
- Open an existing Silverlight 2 or Silverlight 3 application
- Open the AppManifest.xml file in the Properties folder, which is located in the Solution Explorer.
- Uncomment the markup and make changes to the Deployment.Application element to describe your application
- Add icons to the application (optional)
Hello World Offline
- Create a new Silverlight application.
- Add a TextBlock with the text Hello World!.
- Compile and run the program.
- Right-click on the application to open the context menu. The Install onto this computer option is disabled.
- Close the application.
- Open the AppManifest.xml file in the Solution Explorer.
- Uncomment the markup by removing the comment tags.
- Change ShortName to Hello World. This is the text that will be displayed on the desktop.
- Change Title to Offline Hello World App. This is the text that will be displayed on the application's title bar.
- Change the contents of the ApplicationIdentity.Blurb element to This is a sample Hello World application. This value is displayed in the application's properties.
- Compile and run the program.
- Right-click on the application to open the context menu. The Install Hello World onto this computer option is enabled.
- Select the option. The Install application dialog opens and gives you the option to install on the Start menu and/or Desktop.
- Check Start menu and Desktop and select OK.
- The application installs on the desktop and loads in its own window. The Desktop and Start menu both display a default icon for the application.
-
Right-click on the application to open the context menu, The Remove this application option allows you to remove the application from the computer.
Conclusion
You can now allow your Silverlight applications to run offline in a matter of
minutes.