次の方法で共有


Utility.ImportAppLicense method

Imports the specified test license into the specified SharePoint deployment for app testing purposes.

Namespace:  Microsoft.SharePoint.Client.Utilities
Assembly:  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

Syntax

'Declaration
Public Shared Sub ImportAppLicense ( _
    context As ClientRuntimeContext, _
    licenseTokenToImport As String, _
    contentMarket As String, _
    billingMarket As String, _
    appName As String, _
    iconUrl As String, _
    providerName As String, _
    appSubtype As Integer _
)
'Usage
Dim context As ClientRuntimeContext
Dim licenseTokenToImport As String
Dim contentMarket As String
Dim billingMarket As String
Dim appName As String
Dim iconUrl As String
Dim providerName As String
Dim appSubtype As IntegerUtility.ImportAppLicense(context, licenseTokenToImport, _
    contentMarket, billingMarket, appName, _
    iconUrl, providerName, appSubtype)
public static void ImportAppLicense(
    ClientRuntimeContext context,
    string licenseTokenToImport,
    string contentMarket,
    string billingMarket,
    string appName,
    string iconUrl,
    string providerName,
    int appSubtype
)

Parameters

  • licenseTokenToImport
    Type: System.String

    An XML fragment that represents the app license token to import.

  • contentMarket
    Type: System.String

    The content market in which you want to sell the app.

  • billingMarket
    Type: System.String

    The billing market for the app.

  • iconUrl
    Type: System.String

    URL of the app icon, as it appears on Office Store. Can be left blank.

  • providerName
    Type: System.String

    Name of the provider of the app.

  • appSubtype
    Type: System.Int32

    The subtype of the app.

    Use this parameter to specify whether this license is for an app for SharePoint used exclusively to package an app for Office, and if so, the type of app for Office. This enables corporate catalogs to filter and display apps for Office packaged in apps for SharePoint.

    Valid values are limited to:

    Value

    Description

    1

    An app for SharePoint used to package a single task pane app for Office.

    2

    An app for SharePoint used to package a single content app for Office.

    4

    An app for SharePoint used to package a single dictionary task pane app for Office.

    5

    An app for SharePoint that is not being used exclusively to package an app for Office. This includes:

    • An app for SharePoint that does not contain any apps for Office functionality.

    • An app for SharePoint that, in addition to its SharePoint-specific functionality, installs documents and/or templates that contain one or more apps for Office.

    • An app for SharePoint that packages multiple apps for Office.

Remarks

In order to call this method, the caller must be one of the following:

  • An administrator of the site collection being called.

  • An administrator of the tenancy into which the license is imported, if the SharePoint deployment into which the license is imported is a tenancy.

  • A farm administrator

To assist in testing the app license checking code in your app, SharePoint enables you to upload up to ten test licenses per SharePoint deployment. These test licenses are XML fragments that conform to the app license schema.

For test licenses, you need not specify the deployment ID in the app license XML. The ImportAppLicense method supplies the correct deployment ID to the license token XML.

For more information about the app license XML definition, see Office and SharePoint Add-in license XML schema structure. For more information about app licenses, see License your Office and SharePoint Add-ins.

See also

Reference

Utility class

Utility members

Microsoft.SharePoint.Client.Utilities namespace