我在通过 UIPath 辅助运行自动化时出现以下错误,
活动 'Main' 的 CacheMetadata 抛出了 'System.Xaml.XamlObjectWriterException: 无法创建未知类型 '{http://schemas.microsoft.com/netfx/2009/xaml/activities}Variable({clr-namespace:Microsoft.Identity.Client;assembly=Microsoft.Identity.Client}IPublicClientApplication)'.at System.Xaml.XamlObjectWriter.WriteStartObject(XamlType xamlType) at System.Xaml.XamlWriter.WriteNode(XamlReader reader) at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter) at System.Activities.XamlIntegration.FuncFactory
1.Evaluate() at System.Activities.DynamicActivity.OnInternalCacheMetadata(Boolean createEmptyBindings) at System.Activities.Activity.InternalCacheMetadata(Boolean createEmptyBindings, IList
1& validationErrors) at System.Activities.ActivityUtilities.ProcessActivity(ChildActivity childActivity, ChildActivity&nextActivity, Stack1& activitiesRemaining, ActivityCallStack parentChain, IList
1& validationErrors,ProcessActivityTreeOptions options, ProcessActivityCallback callback) at System.Activities.ActivityUtilities.ProcessActivityTreeCore(ChildActivity currentActivity, ActivityCallStack parentChain, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList1& validationErrors) at System.Activities.ActivityUtilities.CacheRootMetadata(Activity activity, LocationReferenceEnvironment hostEnvironment, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList
1& validationErrors) at System.Activities.XamlIntegration.ActivityXamlServices.RequiresCompilation(IDynamicActivity dynamicActivity, LocationReferenceEnvironment environment, String&语言)'。at System.Activities.XamlIntegration.ActivityXamlServices.RequiresCompilation(IDynamicActivity dynamicActivity, LocationReferenceEnvironment environment, String& language) at System.Activities.XamlIntegration.ActivityXamlServices.Compile(IDynamicActivity dynamicActivity, LocationReferenceEnvironment environment) at System.Activities.XamlIntegration.ActivityXamlServices.Load(XamlReader xamlReader, ActivityXamlServicesSettings settings) atSystem.Activities.XamlIntegration.ActivityXamlServices.Load(XmlReader xmlReader, ActivityXamlServicesSettings settings) at System.Activities.XamlIntegration.ActivityXamlServices.Load(Stream stream, ActivityXamlServicesSettings settings) at UiPath.Executor.WorkflowRuntime.Load(String workflowFile) at UiPath.Executor.RobotRunner.InitWorkflowApplication() at UiPath.Executor.RobotRunner.d__84.MoveNext()
我已经通过执行以下步骤来解决。
转到:C:\User\{YourUser}\AppData\Roaming\NuGet,如果找到NuGet.Config文件,则将其删除。
- 现在转到UIPath工作室并单击开始。
- 单击"处理",您将获得"新建空白进程"。
- 请选择语言并单击创建,您将获得设计页面。单击管理包,然后转到所有包。
- 现在搜索UIPath.Web.Activity并选择 安装并单击 保存 。
重新启动 UIPath,它应该可以工作。