发布 SharePoint 加载项Publish SharePoint Add-ins

已完成 SharePoint 加载项开发,最后一步是要向用户发布加载项。You've finished developing your SharePoint Add-in—the final step is to make it available to your users. 为此,可以将加载项发布到 AppSource(旧称为“Office 应用商店”),并添加到 SharePoint 类别中。You can do this by publishing the add-in to AppSource (formerly Office Store) and making it available within SharePoint.

  • AppSource:将加载项发布到 AppSource,以公开提供加载项,这样所有 SharePoint 部署用户都能够获取它。AppSource Publish your add-in to AppSource to make it publically available, so that it can be acquired by users of any SharePoint deployment.

  • 内部组织加载项目录:将加载项发布到内部组织加载项目录(托管在 SharePoint 部署上),以便访问相应 SharePoint 部署的用户都能够获取加载项。An internal organization add-in catalog Publish your add-in to an internal organization add-in catalog, hosted on your SharePoint deployment, to make it available to users who access that SharePoint deployment.

若要了解如何使用 Visual Studio 2012 打包加载项以供发布,请参阅使用 Visual Studio 发布 SharePoint 加载项For information about how to package your add-in for publication by using Visual Studio 2012, see Publish SharePoint Add-ins by using Visual Studio.

发布到 AppSourcePublishing to AppSource

若要将加载项发布到 AppSource,必须先以 Microsoft 开发人员身份注册To publish an add-in to AppSource, you must first register as a Microsoft developer.

在开发人员将加载项上传到 AppSource 以供发布时,Microsoft 会执行审批流程。When you upload an add-in to AppSource for publication, there is an approval process that Microsoft performs. 例如,它会检查加载项是否有病毒,以及加载项清单标记是否完整有效,并验证在加载项中添加的任何 SharePoint 解决方案包(.wsp 文件)是否不含禁止使用的元素或范围超出 Web 的 SharePoint 功能。For example, it checks that the add-in is free of viruses, whether the add-in manifest markup is valid and complete and verifies that any SharePoint solution packages (.wsp files) that you included in the add-in do not contain elements that aren't allowed, or SharePoint features with a scope that is broader than web. 还会检查包中是否有令人不能接受的内容。The package is also inspected for objectionable content. 如果加载项包通过了验证,就会被打包成经 Microsoft 签名的文件。If the add-in package passes verification, it's wrapped into a file and signed by Microsoft.

上传加载项以供在 AppSource 上发布时,可以选择要向下载它的用户显示的许可条款。When you upload your add-in for publication on AppSource, you can choose the terms of the license you want to offer users when they download it. 此加载项许可条款可用于决定:Use this add-in license to decide:

  • 提供的加载项是免费、试用还是需要购买。Whether you are offering your add-in for free, trial, or for purchase.
  • 加载项是供各个用户获取,还是供各个网站获取。Whether your add-in can be acquired on a per-user or site basis.

SharePoint 不强制执行与加载项使用相关的许可条款,SharePoint does not enforce license terms for add-in usage. 而是提供许可框架。借助此框架,可以在加载项中添加代码逻辑,以强制执行任何选定许可限制。Instead, it provides a licensing framework that lets you include code logic in your add-in to enforce whatever licensing restrictions you choose. 例如,可以在加载项中添加代码逻辑,从而允许有付费许可证的用户使用特定加载项功能,禁止有试用许可证的用户使用。For example, you can include code logic in your add-in that enables users to access certain add-in features if they have a paid license, but not if they have a trial license. 有关详细信息,请参阅许可 Office 和 SharePoint 加载项For more information, see License your Office and SharePoint Add-ins.

发布到加载项目录Publishing to an add-in catalog

如果您创建 SharePoint 外接程序以供您自己的公司或特定企业客户端使用,而不是面向一般公众,则您可能要将外接程序发布到在 SharePoint 上托管的内部外接程序目录。专用外接程序目录是 SharePoint Web 应用程序(或 SharePoint Online 租赁)中的一个专用网站集合,用于托管 SharePoint 外接程序和 Office 外接程序的文档库。将目录放在自己的站点集合中更便于 Web 应用程序管理员或租户管理员来限制对该目录的权限。If you're creating SharePoint Add-ins for your own company's use or a specific corporate client, instead of the general public, you'll likely want to publish your add-in to an internal add-in catalog hosted on SharePoint. A private add-in catalog is a dedicated site collection in a SharePoint web application (or a SharePoint Online tenancy) that hosts document libraries for SharePoint Add-ins and Office Add-ins. Putting the catalog into its own site collection makes it easier for the web application administrator or tenant administrator to limit permissions to the catalog.

将 SharePoint 加载项上传到企业加载项目录就像将任何文件上传到 SharePoint 文档库一样简单。Uploading a SharePoint Add-in to a corporate add-in catalog is as easy as uploading any file to a SharePoint document library. 只需填写弹出式表单,在其中提供加载项包的本地 URL 和其他信息(如加载项名称)即可。You fill out a pop-up form in which you supply the local URL of the add-in package and other information, such as the name of the add-in. 上传到加载项目录的加载项也会经历一些类似的检查,未通过检查的加载项在目录中标记为无效或已禁用。When you upload the add-in to an add-in catalog, there are similar checks, and add-ins that do not pass are marked as invalid or disabled in the catalog.

确定 SharePoint 加载项发布位置Deciding where to publish your SharePoint Add-in

下表比较了发布到 AppSource 和发布到加载项目录,并列出了在决定加载项发布位置时需要考虑的问题。The following table offers a comparison of publishing to AppSource or to an add-in catalog, and lists issues to consider when deciding where to publish your add-in. 建议在设计和开发加载项前,就决定打算在哪里发布加载项;在某些情况(如授权)下,加载项发布位置会影响加载项的设计和开发。We recommend you decide where you plan to publish your add-in before you design and develop it; in some cases, such as licensing, where you publish your add-in will affect the design and development of your add-in.

表 1:加载项发布位置的注意事项Table 1. Considerations for where to publish your add-in

AppSourceAppSource 加载项目录Add-in Catalog
加载项可公开访问。Add-in is publically available. 只有有权访问此 SharePoint 部署的用户,才能访问加载项。Add-in is available to users with access to this SharePoint deployment.
许可框架可用。Licensing framework is available. 许可框架不可用。Licensing framework is not available for use.
Microsoft 会验证加载项包的技术和内容是否符合策略。Add-in package is verified by Microsoft for technical and content adherence to policies. SharePoint 会验证上传的加载项包。Add-in package verification is performed by SharePoint when add-in is uploaded.
必须向 Microsoft 卖家面板注册,才能上传加载项。You must be signed up with the Microsoft Seller Dashboard to upload add-ins. 无需向 Microsoft 注册。No registration with Microsoft is required.

另请参阅See also