共用方式為


Deployment Class

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Provides application part and localization information in the application manifest when deploying a Silverlight-based application.

Inheritance Hierarchy

System.Object
  System.Windows.DependencyObject
    System.Windows.Deployment

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Public NotInheritable Class Deployment _
    Inherits DependencyObject
public sealed class Deployment : DependencyObject
<Deployment
  xmlns="https://schemas.microsoft.com/client/2007/deployment" ... >
  ...
</Deployment>

The Deployment type exposes the following members.

Constructors

  Name Description
Public methodSupported by Silverlight for Windows Phone Deployment Infrastructure. Initializes a new instance of the Deployment class.

Top

Properties

  Name Description
Public propertyStatic memberSupported by Silverlight for Windows Phone Current Gets the current Deployment object.
Public propertySupported by Silverlight for Windows Phone Dispatcher Gets the Dispatcher this object is associated with. (Inherited from DependencyObject.)
Public propertySupported by Silverlight for Windows Phone EntryPointAssembly Gets a string name that identifies which part in the Deployment is the entry point assembly.
Public propertySupported by Silverlight for Windows Phone EntryPointType Gets a string that identifies the namespace and type name of the class that contains the Application entry point for your application.
Public property ExternalCallersFromCrossDomain Gets a value that indicates the level of access that cross-domain callers have to the Silverlight-based application in this deployment.
Public propertySupported by Silverlight for Windows Phone ExternalParts Gets a collection of ExternalPart instances that represent the external assemblies required by the application.
Public property InBrowserSettings Gets an object that contains information about the application that is used for in-browser support.
Public property OutOfBrowserSettings Gets an object that contains information about the application that is used for out-of-browser support.
Public propertySupported by Silverlight for Windows Phone Parts Gets a collection of assembly parts that are included in the deployment.
Public propertySupported by Silverlight for Windows Phone RuntimeVersion Gets the Silverlight runtime version that this deployment supports.

Top

Methods

  Name Description
Public methodSupported by Silverlight for Windows Phone CheckAccess Determines whether the calling thread has access to this object. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows Phone ClearValue Clears the local value of a dependency property. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows Phone Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows Phone Finalize Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone GetAnimationBaseValue Returns any base value established for a Silverlight dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject.)
Public methodStatic member GetAppIdForUri Infrastructure. Security Critical. Gets a value that represents a unique ID for an out-of-browser application.
Public methodSupported by Silverlight for Windows Phone GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone GetType Gets the Type of the current instance. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone GetValue Returns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject.)
Protected methodSupported by Silverlight for Windows Phone MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone ReadLocalValue Returns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject.)
Public methodStatic member RegisterAssembly Infrastructure. Security Critical. Enables a native Silverlight host, such as Expression Blend or Visual Studio, to instruct Silverlight to register an assembly that the Silverlight host has separately loaded into the host-managed application domain in which a Silverlight application is running.
Public methodStatic member SetCurrentApplication Infrastructure. Security Critical. Allows a native host of the Silverlight plug-in to specify the current Application object of the running Silverlight application.
Public methodSupported by Silverlight for Windows Phone SetValue Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows Phone ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Fields

  Name Description
Public fieldStatic memberSupported by Silverlight for Windows Phone EntryPointAssemblyProperty Identifies the EntryPointAssembly dependency property.
Public fieldStatic memberSupported by Silverlight for Windows Phone EntryPointTypeProperty Identifies the EntryPointType dependency property.
Public fieldStatic member ExternalCallersFromCrossDomainProperty Identifies the ExternalCallersFromCrossDomain dependency property.
Public fieldStatic memberSupported by Silverlight for Windows Phone ExternalPartsProperty Identifies the ExternalParts dependency property.
Public fieldStatic member InBrowserSettingsProperty Identifies the InBrowserSettings dependency property.
Public fieldStatic member OutOfBrowserSettingsProperty Identifies the OutOfBrowserSettings dependency property.
Public fieldStatic memberSupported by Silverlight for Windows Phone PartsProperty Identifies the Parts dependency property.
Public fieldStatic memberSupported by Silverlight for Windows Phone RuntimeVersionProperty Identifies the RuntimeVersion dependency property.

Top

Remarks

The markup for application manifests is technically XAML. However the various elements for manifests are not included in the typical default Silverlight XML namespace (https://schemas.microsoft.com/winfx/2006/xaml/presentation). Instead, the manifest elements are mapped to the https://schemas.microsoft.com/client/2007/deployment XML namespace.

Generally, you do not have to change the XAML in an application manifest if the project specifies that each build should generate the application manifest. In contrast to the very basic usage shown in the XAML Object Element Usage section above, a typical Deployment would also specify additional attributes, and might also contain property elements for Parts, ExternalParts, and OutOfBrowserSettings.

You can retrieve a Deployment object in managed code through the Current property. This gives you read-only access to the deployment settings. To set deployment values, you must modify the AppManifest.xaml file deployed with your application package.

In Visual Studio, the AppManifest.xaml file is generated by the build based on information that you specify in the project designer. For more information, see Silverlight Page, Project Designer.

By default, the build generates the AppManifest.xaml from a template in the Properties folder named AppManifest.xml. You can specify values in the manifest template or you can disable manifest generation to provide your own AppManifest.xaml file. This is useful, for example, to specify non-default values for the RuntimeVersion and ExternalCallersFromCrossDomain properties.

NoteNote:

You should not specify out-of-browser settings in the manifest template if you specify the same values by using the project designer or the OutOfBrowserSettings.xml file. For more information, see How to: Configure an Application for Out-of-Browser Support.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.