Aracılığıyla paylaş


SolutionPackage.Generate Method (X509Certificate2, String, Boolean)

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, _
    selfSigned As Boolean _
) As String
'Usage
Dim instance As SolutionPackage
Dim cert As X509Certificate2
Dim targetDocLibRelativePath As String
Dim selfSigned As Boolean
Dim returnValue As String

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

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.

  • selfSigned
    Type: System.Boolean

    true to indicate that the specified certificate is self-signed and to bypass checking whether the root certificate is trusted; false to indicate that the specified certificate is not self-signed and to check whether the root certificate is trusted.

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 (except for the error that occurs when the root certificate of the specified certificate is not trusted.) An example of such an error is when the specified certificate has expired. For details about the chain status, see X509ChainStatusFlags Enumeration.

  2. selfSigned is false and the root certificate of the specified certificate is not trusted.

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

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

  5. 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).

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

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

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

See Also

Reference

SolutionPackage Class

SolutionPackage Members

Generate Overload

Microsoft.Office.SharePoint.ClientExtensions.Publishing Namespace