Aracılığıyla paylaş


SolutionPackage.Generate Method (X509Certificate2, String)

Generates the package and signs it with the given certificate.

Namespace:  Microsoft.Office.SharePoint.ClientExtensions.Publishing
Assembly:  Microsoft.Office.SharePoint.ClientExtensions (in Microsoft.Office.SharePoint.ClientExtensions.dll)

Syntax

'Declaration
Public Function Generate ( _
    cert As X509Certificate2, _
    targetDocLibRelativePath As String _
) As String
'Usage
Dim instance As SolutionPackage
Dim cert As X509Certificate2
Dim targetDocLibRelativePath As String
Dim returnValue As String

returnValue = instance.Generate(cert, _
    targetDocLibRelativePath)
public string Generate(
    X509Certificate2 cert,
    string targetDocLibRelativePath
)

Parameters

  • targetDocLibRelativePath
    Type: System.String

    The path of the document library where the package should be published. This path is relative to the site URL.

Return Value

Type: System.String
The solution package URL string.

Exceptions

Exception Condition
PublishException

This exception is thrown if any of the following conditions applies:

  1. The certificate chain for the specified certificate is in error, e.g. the root certificate of the specified certificate is not trusted or the specified certificate has expired. For details about the chain status, see X509ChainStatusFlags Enumeration.

  2. The site, which was provided in the constructor, does not exist.

  3. The "Offline Synchronization for External Lists" SharePoint feature is not active for the SharePoint site.

  4. The source document library path specified in the constructor or the target document library path specified in this method is a null reference (Nothing in Visual Basic).

  5. The source document library specified in the constructor or the target document library does not exist on the SharePoint site.

  6. The source document library is the same as the target document library.

  7. The oir.config file is not included in the source document library.

Examples

Code Snippet: Create a BCS Solution Package for a Declarative Solution

See Also

Reference

SolutionPackage Class

SolutionPackage Members

Generate Overload

Microsoft.Office.SharePoint.ClientExtensions.Publishing Namespace