Application Development Overview

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Silverlight is a technology that enables application developers to create and deploy Web applications that run in the browser.

This topic contains the following sections.

For information about Silverlight application deployment, see Deployment (Silverlight 2).

When developing for Silverlight, you must understand the structure of a Silverlight application. A Silverlight application includes the following:

  • [Required] An application class and services that are implemented by the application assembly. Included in the application package.

  • [Optional] In-package library assemblies and resources files that encapsulate application user interface (UI) and functionality. Included in the application package.

  • [Optional] On-demand library assemblies and resource files that encapsulate optional UI and functionality. Included alongside the application package.

For an illustration of the Silverlight application structure, click here.

Each Silverlight application must at least implement the functionality to start running after it is downloaded by the Silverlight plug-in. The Silverlight plug-in expects every Silverlight application to implement its startup functionality in a specific, well-known way, known as the entry point. In a Silverlight application, the entry point is a combination of the following:

  • A class that derives from Application, known as the application class.

  • An assembly that contains the application class, known as the application assembly.

  • Metadata that identifies the application class and application assembly that make up the entry point.

For more information about how to implement and package an application class and application assembly, see Developing a Silverlight Application Assembly.

The Application class provides several application services that are usually required by applications. The most important service is the ability to specify the UI to display when the application starts. Additionally services include lifetime management, application-scoped resources and properties, access to initialization parameters, and unhandled exception detection and response.

For more information about services provided by the Application class, see Application Services.

A Silverlight library assembly is used to encapsulate additional application UI and functionality. Library assemblies are used for a variety of reasons, such as organizing an application into smaller parts and sharing UI and functional across multiple applications.

For more information about how to develop Silverlight library assemblies, see Developing a Silverlight Library Assembly.

While application and library assemblies encapsulate the executable aspects of a Silverlight application, a Silverlight application can also include non-executable data, such as audio, video, image, XML, and XAML files. These types of files are known collectively as resource files, and can be packaged in a wide variety of ways.

For more information about working with resource files, see Resource Files.

The application package is what the Silverlight plug-in downloads to start an Silverlight application. The application package is a ZIP file archive with the .xap file name extension.

The application package must be as small as possible to provide the fastest possible download. Consequently, the only files that should be included in the application are those that contain the UI and functionality that an application cannot run without. Files that are included in the application package, such as the application assembly, library assemblies, and resource files, are referred to as in-package files. The files that contain the optional UI and functionality of an application and can be downloaded as needed are known on-demand files.

The right balance of in-package and on-demand files enables users to have the smallest possible initial download for the necessary application UI and functionality, while still enabling additional features to be downloaded.

For more information about how to deploy library assemblies either in-package or on-demand, see Developing a Silverlight Library Assembly. For more information about how to download resource files, see Resource Files.