是否可以对项目进行增量发布? 我试图通过以下方式做到这一点:
var masterDatabase = Factory.GetDatabase("master");
var webDatabase = Factory.GetDatabase("web");
var contentItem = masterDatabase.GetItem("/sitecore/content/path to item");
PublishOptions options = new PublishOptions(
masterDatabase,
webDatabase,
PublishMode.Incremental,
Language.Current,
DateTime.Now)
{
RootItem = contentItem,
Deep = true
};
Publisher publisher = new Publisher(options);
publisher.PublishAsync();
但我在最后一行收到以下错误:
An exception of type 'System.InvalidOperationException' occurred in Sitecore.Kernel.dll but was not handled in user code. Additional information: A root item can not be specified for incremental publishing
contentItem
变量是一个桶,其中包含其他可桶化的项目。
有什么方法可以做增量发布吗?
最佳答案
没有。这是不可能的。 Incremental
仅适用于整个数据库。
对于项目只有这两个选项是可能的:
- 智能发布 - 发布源数据库和目标数据库之间的差异。
- 重新发布 - 发布所有内容。
关于c# - 项目的 Sitecore 增量发布,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42651116/