升级到Sitecore 8.2后出现Glassmapper异常
在升级到Sitecore 8.2和glass mapper版本4.3.4.197后,我得到以下例外情况 异常:Message=“未能找到父项的配置 键入Sitecore.Data.Items.Item“ 我的代码如下: 将项目保存到主数据库中升级到Sitecore 8.2后出现Glassmapper异常,sitecore,sitecore8.2,Sitecore,Sitecore8.2,在升级到Sitecore 8.2和glass mapper版本4.3.4.197后,我得到以下例外情况 异常:Message=“未能找到父项的配置 键入Sitecore.Data.Items.Item“ 我的代码如下: 将项目保存到主数据库中 Parent Item type = Sitecore.Data.Items var newItem = sitecoreContext.Create(parentItem , fixed); 我也遇到了同样的问题,发现如果将父项强制转换为特定的模板
Parent Item type = Sitecore.Data.Items
var newItem = sitecoreContext.Create(parentItem , fixed);
我也遇到了同样的问题,发现如果将父项强制转换为特定的模板,它似乎可以工作。例如,代替
Item父项=sitecoreService.GetItem(GUID);
ChildTemplateType childItem=sitecoreService.Create(父、子数据);
使用:
Item父项=sitecoreService.GetItem(GUID);
ParentTemplateType parentCasted=sitecoreService.Cast(父级);
ChildTemplateType childItem=sitecoreService.Create(parentCasted,childData)代码>