Share via


ImportSolutionRequest Class

 

Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online

Contains the data that is needed to import a solution.

For the Web API use the ImportSolution Action.

Namespace:   Microsoft.Crm.Sdk.Messages
Assembly:  Microsoft.Crm.Sdk.Proxy (in Microsoft.Crm.Sdk.Proxy.dll)

Inheritance Hierarchy

System.Object
  Microsoft.Xrm.Sdk.OrganizationRequest
    Microsoft.Crm.Sdk.Messages.ImportSolutionRequest

Syntax

[DataContractAttribute(Namespace = "https://schemas.microsoft.com/crm/2011/Contracts")]
public sealed class ImportSolutionRequest : OrganizationRequest
<DataContractAttribute(Namespace := "https://schemas.microsoft.com/crm/2011/Contracts")>
Public NotInheritable Class ImportSolutionRequest
    Inherits OrganizationRequest

Constructors

Name Description
System_CAPS_pubmethod ImportSolutionRequest()

Initializes a new instance of the ImportSolutionRequest class

Properties

Name Description
System_CAPS_pubproperty ConvertToManaged

Direct the system to convert any matching unmanaged customizations into your managed solution. Optional.

System_CAPS_pubproperty CustomizationFile

Gets or sets the compressed solutions file to import. Required.

System_CAPS_pubproperty ExtensionData

Gets or sets the structure that contains extra data. Optional.(Inherited from OrganizationRequest.)

System_CAPS_pubproperty HoldingSolution

System_CAPS_pubproperty ImportJobId

Gets or sets the ID of the import job that will be created to perform this import. Required.

System_CAPS_pubproperty Item[String]

Gets or sets the indexer for the Parameters collection.(Inherited from OrganizationRequest.)

System_CAPS_pubproperty OverwriteUnmanagedCustomizations

Gets or sets whether any unmanaged customizations that have been applied over existing managed solution components should be overwritten. Required.

System_CAPS_pubproperty Parameters

Gets or sets the collection of parameters for the request. Required, but is supplied by derived classes.(Inherited from OrganizationRequest.)

System_CAPS_pubproperty PublishWorkflows

Gets or sets whether any processes (workflows) included in the solution should be activated after they are imported. Required.

System_CAPS_pubproperty RequestId

Gets or sets the ID of an asynchronous operation (system job). Optional. (Inherited from OrganizationRequest.)

System_CAPS_pubproperty RequestName

Gets or sets the name of the request. Required, but is supplied by derived classes.(Inherited from OrganizationRequest.)

System_CAPS_pubproperty SkipProductUpdateDependencies

Gets or sets whether enforcement of dependencies related to product updates should be skipped.

Methods

Name Description
System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

Remarks

Message Availability

For this message to work, the caller must be connected to the server.

Usage

This request is the only one that can be called either synchronously or asynchronously.

To use this messages synchronously, pass an instance of this class to the Execute method, which returns an instance of ImportSolutionResponse.

To use this message asynchronously, instantiate a ExecuteAsyncRequest and set the Request property to an instance of this class. Use the Execute method to return an ExecuteAsyncResponse. The Results property will contain the ImportSolutionResponse. Use the ExecuteAsyncResponse.AsyncJobId to track the success of the solution import.

Privileges and Access Rights

To perform this action, the caller must have privileges listed in ImportSolution message privileges.

Notes for Callers

Examples

The following example shows how to use this message. For this sample to work correctly, you must be connected to the server to get an IOrganizationService interface. For the complete sample, see the link later in this topic.


// Install or Upgrade a Solution                  

byte[] fileBytes = File.ReadAllBytes(ManagedSolutionLocation);

ImportSolutionRequest impSolReq = new ImportSolutionRequest()
{
    CustomizationFile = fileBytes
};

_serviceProxy.Execute(impSolReq);

Console.WriteLine("Imported Solution from {0}", ManagedSolutionLocation);

' Install or Upgrade a Solution                  

Dim fileBytes() As Byte = File.ReadAllBytes(ManagedSolutionLocation)

Dim impSolReq As New ImportSolutionRequest() With {
 .CustomizationFile = fileBytes
}

_serviceProxy.Execute(impSolReq)

Console.WriteLine("Imported Solution from {0}", ManagedSolutionLocation)

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.

See Also

Microsoft.Crm.Sdk.Messages Namespace
Sample: Work with solutions
Package and distribute extensions using solutions

Return to top

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright