C# Windows 10-WUApiLib异常

C# Windows 10-WUApiLib异常,c#,windows-10,windows-update,C#,Windows 10,Windows Update,我已经为Windows7和Windows8.1编写了一个自动化windows更新任务的工具 在Windows 10下测试该工具时,现在会抛出System.Runtime.InteropServices.COMException,错误代码为HRESULT:0x80080005(CO_E_SERVER_EXEC_FAILURE),同时从iAutomaticUpdate创建第一个对象,如下所示: private IAutomaticUpdates _automaticUpdates = new Aut

我已经为Windows7和Windows8.1编写了一个自动化windows更新任务的工具

在Windows 10下测试该工具时,现在会抛出System.Runtime.InteropServices.COMException,错误代码为HRESULT:0x80080005(CO_E_SERVER_EXEC_FAILURE),同时从iAutomaticUpdate创建第一个对象,如下所示:

private IAutomaticUpdates _automaticUpdates = new AutomaticUpdates();
我确信原因是整个windows update过程中的变化——但我找不到足够的新API来通过C#操作windows update

有人给我一个提示吗


Greetz

用平台目标“AnyCPU”编译应用程序解决了这个问题。不幸的是,我的应用程序依赖于“x86”。使用平台目标“AnyCPU”编译应用程序解决了这个问题。不幸的是,我的应用程序依赖于“x86”。