SharePoint迁移工具无法运行或重装的故障排查求助
问题背景
修改工作文件夹时强制终止SharePoint迁移工具进程后,出现以下问题:
- 迁移工具无法启动
agentsetup.exe运行失败,无法重新安装- Microsoft 365 Migration Agent在「程序和功能」中显示,但无法卸载
- 已排查注册表、WMIC、DISM、SFC,重装.NET 4.6.5及使用.NET修复工具,均未解决
错误日志分析
.NET Runtime错误(事件ID 1026)
核心异常为Newtonsoft.Json.JsonReaderException,触发点在AgentSettings.Load()方法,说明迁移工具的配置JSON文件因强制终止进程导致损坏/不完整,进而引发后续的XAML解析异常。
Application: Microsoft.SharePoint.Migration.ClientInstaller.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: Newtonsoft.Json.JsonReaderException at Newtonsoft.Json.JsonTextReader.ReadStringIntoBuffer(Char) at Newtonsoft.Json.JsonTextReader.ReadStringValue(Newtonsoft.Json.ReadType) at Newtonsoft.Json.JsonTextReader.ReadAsString() at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(Newtonsoft.Json.JsonReader, Newtonsoft.Json.Serialization.JsonContract, Boolean) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(System.Object, Newtonsoft.Json.JsonReader, Newtonsoft.Json.Serialization.JsonObjectContract, Newtonsoft.Json.Serialization.JsonProperty, System.String) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(Newtonsoft.Json.JsonReader, System.Type, Newtonsoft.Json.Serialization.JsonContract, Newtonsoft.Json.Serialization.JsonProperty, Newtonsoft.Json.Serialization.JsonContainerContract, Newtonsoft.Json.Serialization.JsonProperty, System.Object) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(Newtonsoft.Json.JsonReader, System.Type, Boolean) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(Newtonsoft.Json.JsonReader, System.Type) at Newtonsoft.Json.JsonConvert.DeserializeObject(System.String, System.Type, Newtonsoft.Json.JsonSerializerSettings) at Newtonsoft.Json.JsonConvert.DeserializeObject[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.String, Newtonsoft.Json.JsonSerializerSettings) at Microsoft.SharePoint.Migration.ClientLib.Common.AgentSettings.Load() at Microsoft.SharePoint.Migration.ClientLib.Common.AgentSettings.get_Instance() at Microsoft.SharePoint.Migration.ClientInstaller.Common.InstallWizard.InitInstallWorker(Boolean) at Microsoft.SharePoint.Migration.ClientInstaller.PagesStructure.InitAllPages(Microsoft.SharePoint.Migration.ClientInstaller.MainWindow) at Microsoft.SharePoint.Migration.ClientInstaller.MainWindow..ctor() Exception Info: System.Windows.Markup.XamlParseException at System.Windows.Markup.XamlReader.RewrapException(System.Exception, System.Xaml.IXamlLineInfo, System.Uri) at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri) at System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri) at System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean) at System.Windows.Application.LoadBamlStreamWithSyncInfo(System.IO.Stream, System.Windows.Markup.ParserContext) at System.Windows.Application.DoStartup() at System.Windows.Application.<.ctor>b__1_0(System.Object) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr) at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef) at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame) at System.Windows.Application.RunDispatcher(System.Object) at System.Windows.Application.RunInternal(System.Windows.Window) at Microsoft.SharePoint.Migration.ClientInstaller.App.Main()
应用程序错误(事件ID 1000)
此错误是前述JSON解析异常引发的连锁反应,核心问题仍在损坏的配置文件。
Faulting application name: Microsoft.SharePoint.Migration.ClientInstaller.exe, version: 1.1.0.32, time stamp: 0x64142ce5 Faulting module name: KERNELBASE.dll, version: 10.0.19041.2788, time stamp: 0x62e593d6 Exception code: 0xe0434352 Fault offset: 0x000000000002cb69 Faulting process id: 0x2360 Faulting application start time: 0x01d976c2b86ef13b Faulting application path: \AppData\Local\Temp\SPMigrationAgentSetup\SPMigrationAgentSetup\Microsoft.SharePoint.Migration.ClientInstaller.exe Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll Report Id: 60127fdb-c018-40c6-8c17-32ef7e6686c5 Faulting package full name: Faulting package-relative application ID:
修复步骤
1. 删除损坏的配置文件
- 打开文件资源管理器,输入
%LOCALAPPDATA%\Microsoft\SharePoint Migration Agent,删除目录下所有JSON格式的配置文件(如AgentSettings.json) - 输入
%PROGRAMDATA%\Microsoft\SharePoint Migration Agent,重复上述操作 - 删除临时安装缓存:输入
%TEMP%,找到并删除SPMigrationAgentSetup文件夹
2. 强制卸载残留的迁移代理
- 打开管理员命令提示符,执行以下命令强制卸载:
wmic product where "name like '%Microsoft 365 Migration Agent%'" call uninstall - 如果WMIC命令无效,改用PowerShell(管理员权限):
Get-WmiObject -Class Win32_Product | Where-Object {$_.Name -match "Microsoft 365 Migration Agent"} | ForEach-Object {$_.Uninstall()} - 若仍无法卸载,使用微软的Program Install and Uninstall Troubleshooter工具扫描并移除残留项
3. 修复.NET Framework环境
- 卸载已安装的.NET 4.6.5,下载并安装最新版.NET Framework 4.8(兼容性更强)
- 打开管理员命令提示符,清理更新缓存:
net stop wuauserv rd /s /q C:\Windows\SoftwareDistribution\Download net start wuauserv
4. 重新安装迁移工具
- 下载最新版SharePoint迁移工具安装包
- 右键点击
agentsetup.exe,选择以管理员身份运行 - 安装过程中临时关闭杀毒软件和防火墙的实时防护
内容的提问来源于stack exchange,提问作者Troy Osborne
相关产品推荐
相关产品推荐

