保存冲突您的更改与另一个用户在Microsoft.SharePoint.Deployment.FileSerializer.CreateOrUpdateFileWithGuid上同时进行的更改发生冲突. [英] Save Conflict Your changes conflict with those made concurrently by another user at Microsoft.SharePoint.Deployment.FileSerializer.CreateOrUpdateFileWithGuid

查看:78
本文介绍了保存冲突您的更改与另一个用户在Microsoft.SharePoint.Deployment.FileSerializer.CreateOrUpdateFileWithGuid上同时进行的更改发生冲突.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用SharePoint2016.将项目导入SharePoint库时,我们会遇到错误消息.我们要导出库的最新主版本,然后导入到目标系统.导入时,我们会收到"Save Conflict"(保存冲突)信息, 错误消息,如以下代码片段所示.

We are using SharePoint 2016. We are experiencing error messages when importing items to SharePoint libraries. We want to export most recent major version of the library and import to the destination system. While importing we are getting "Save Conflict" error messages as in the following snippet.

System.Runtime.InteropServices.COMException: <nativehr>0x8107054a</nativehr><nativestack></nativestack>Save Conflict  Your changes conflict with those made concurrently by another user. If you want your changes to be applied, click Back in your Web browser, refresh the page, and resubmit your changes., StackTrace:   
 at Microsoft.SharePoint.Deployment.FileSerializer.CreateOrUpdateFileWithGuid(SPFileStream spstm, SPLoggerObject loggerObject, SPWeb web, Guid fileId, String fileUrl, Int32 authorId, String authorLoginName, Int32 editorId, String editorLoginName, String checkinComment, DateTime timeCreated, DateTime timeLastModified, MetaInfoHandler metaInfo, Int32 length, Int32 iVersion, Boolean isFirstVersion, SPImportSettings settings, Int32 listItemId, String listInternalName, ImportObjectManager objectManager)    

下一个代码片段显示了我们用于从源系统导出库的代码.如果我们使用SPIncludeVersions.LastMajor选项,则会发生错误.如果我们在源系统上的库上禁用版本控制,或者我们使用SPIncludeVersions.All 选项,那么我们不会收到错误消息.

The next snippet shows the code we are using to export library from the source system. The error happens, if we use SPIncludeVersions.LastMajor option. If we disable versioning on the library on the source system or we use SPIncludeVersions.All option then we do not get the error message.

private static void DoListExport(string listName, bool excludeBlacklistPages)
        {
            try
            {
                LogInfo("Running List Export");
                using (SPSite sourceSite = new SPSite(sourceHostUrl))
                {
                    using (SPWeb sourceWeb = sourceSite.OpenWeb())
                    {
                        SPExportSettings exportSettings = new SPExportSettings();
                        exportSettings.SiteUrl = sourceSite.Url;
                        
                        exportSettings.ExportMethod = SPExportMethodType.ExportAll;

                        exportSettings.BaseFileName = dataFile;
                        exportSettings.FileLocation = workFolder;
                        exportSettings.LogFilePath = workFolder + "\\" + exportLogFile;
                        exportSettings.IncludeSecurity = SPIncludeSecurity.None;
                        exportSettings.OverwriteExistingDataFile = true;
                        exportSettings.CommandLineVerbose = true;
                        exportSettings.FileCompression = false;
                        exportSettings.FileMaxSize = Int32.MaxValue;
                        exportSettings.IncludeVersions = SPIncludeVersions.LastMajor;
                        exportSettings.ExcludeDependencies = true;

                        foreach (SPWeb web in sourceSite.AllWebs)
                        {
                            SPList list = web.Lists.Cast<SPList>().FirstOrDefault(l => l.Title == listName);                            
                                    
                            if(list != null){
                                LogInfo("Exporting list:" + list.Title);
                                var exportObjectList = new SPExportObject();
                                exportObjectList.Id = list.ID;
                                exportObjectList.Type = SPDeploymentObjectType.List;
                                exportObjectList.IncludeDescendants = SPIncludeDescendants.All;
                                exportSettings.ExportObjects.Add(exportObjectList);
                            }
                                                   
                        }
                        exportSettings.Validate();
                        SPExport export = new SPExport(exportSettings);
                        export.Run();


                        LogInfo("Export completed successfully");
                    }
                }
            }
            catch (Exception ex)
            {
                LogError("Error while exporting - " + ex.Message + "-" + ex.StackTrace);
                throw;
            }
        }

下一个代码片段显示了用于将库导入到目标系统的代码.这是引发错误的代码.请帮助找到原因并消除错误.

The next snippet shows the code used to import the library to the destination system. This is the code that throws an error. Please help with finding the reason and eliminating the error.

private static void Import()
        {
            LogInfo("Running Import");

            using (SPSite destinationSite = new SPSite(destinationHostUrl))
            {
                SPWebApplication webApplication = destinationSite.WebApplication;
                destinationSite.AllowUnsafeUpdates = true;                

                using (SPWeb destinationWeb = destinationSite.OpenWeb())
                {
                    destinationWeb.AllowUnsafeUpdates = true;
                    webApplication.FormDigestSettings.Enabled = false;
                    webApplication.FormDigestSettings.Expires = false;
                    SPImportSettings importSettings = new SPImportSettings(new Uri(destinationHostUrl), workFolder, dataFile);
                    importSettings.IncludeSecurity = SPIncludeSecurity.None;
                    importSettings.RetainObjectIdentity = true;
                    importSettings.CommandLineVerbose = true;
                    importSettings.LogFilePath = workFolder + "\\" + importLogFile;
                    importSettings.WebUrl = destinationWeb.Url;
                    importSettings.SiteUrl = destinationSite.Url;
                    importSettings.FileCompression = false;

                    SPImport import = new SPImport(importSettings);
                    import.Run();
                    destinationWeb.AllowUnsafeUpdates = false;
                    webApplication.FormDigestSettings.Enabled = true;
                    webApplication.FormDigestSettings.Expires = true;
                    destinationWeb.Close();
                    LogInfo("Import Process completed successfully");
                }
                destinationSite.AllowUnsafeUpdates = false;
                destinationSite.Close();
            }
            LogInfo("Import Completed Successfully!");
        }

推荐答案

Hi Zenon Staniek,

在搜索该问题时,我发现许多类似的话题都在谈论同一个问题,我不知道您是否已经过了十字架,就像他们在话题中提到的那样,该问题可能是由于以下原因之一原因:-

while googling about the issue, i found many similar threads talking about the same issue , i don't know if you already came a cross or no , As they mentioned in the threads , the issue may due to one of the following reasons:-

1-与目标列表相关联的工作流程,在更新/添加事件时触发.

1- workflow associate with the destination list , fire on updating/adding event.

2-任何事件接收器在添加/更新事件时异步运行.

2- any event receiver runs asynchronous on adding/updating event.

3-如果在目标列表上设置了任何信息管理策略.

3- if there are any Information Management Policies set on the destination list.

3-同样,我发现一个线程在谈论将数据导入目的地时缺少必需的元数据/属性.

3- also, i found a thread talking about missing required metadata/properties while importing the data into the destinations. 

这是与解决方案类似的线程

https://social.msdn.microsoft.com/Forums/office/zh-CN/2d20cc75-e49d-4129-a8a4-4d0361ef8404/save-conflict-your-changes-conflict-with-the-made-concurrently如果您想使用另一个用户?forum = sharepointdevelopment以前的

https://social.msdn.microsoft.com/Forums/office/en-US/2d20cc75-e49d-4129-a8a4-4d0361ef8404/save-conflict-your-changes-conflict-with-those-made-concurrently-by-another-user-if-you-want-your?forum=sharepointdevelopmentprevious

https://social.technet.microsoft.com/Forums/zh-CN/4c6117b7-009f-4f12-9fc5-7d612781f777/save-conflict-when-importing-site-into-empty-site-collection?forum = sharepointadmin上一个

https://social.technet.microsoft.com/Forums/en-US/4c6117b7-009f-4f12-9fc5-7d612781f777/save-conflict-when-importing-site-into-empty-site-collection?forum=sharepointadminprevious

https://social.msdn.microsoft.com/Forums/office/zh-CN/0ed87434-3b03-459f-8ce2-bc12b7e2ec6c/save-conflict-your-changes-conflict-with-the-made-concurrently如果您想使用另一个用户?forum = sharepointdevelopment以前的

https://social.msdn.microsoft.com/Forums/office/en-US/0ed87434-3b03-459f-8ce2-bc12b7e2ec6c/save-conflict-your-changes-conflict-with-those-made-concurrently-by-another-user-if-you-want-your?forum=sharepointdevelopmentprevious

https://social.technet.microsoft.com/Forums/zh-CN/2d20cc75-e49d-4129-a8a4-4d0361ef8404/save-conflict-your-changes-conflict-with-the-made-concurrently-by -如果您想使用另一个用户?forum =以前的sharepointdevelopment

https://social.technet.microsoft.com/Forums/en-US/2d20cc75-e49d-4129-a8a4-4d0361ef8404/save-conflict-your-changes-conflict-with-those-made-concurrently-by-another-user-if-you-want-your?forum=sharepointdevelopmentprevious

我希望以上主题对您有帮助


这篇关于保存冲突您的更改与另一个用户在Microsoft.SharePoint.Deployment.FileSerializer.CreateOrUpdateFileWithGuid上同时进行的更改发生冲突.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆