Error While Installing Custom Activity Built In .Net6

After creating a custom activity using Visual Studio and UiPath Activity Creator extension using .Net Core 6, when trying to install the nuget in Studio, the following error appears:

System.IO.FileNotFoundException: Could not load file or assembly ‘System.Activities, Version=6.0.3.0, Culture=neutral, PublicKeyToken=null’. The system cannot find the file specified.
File name: ‘System.Activities, Version=6.0.3.0, Culture=neutral, PublicKeyToken=null’

After creating a custom activity using Visual Studio and UiPath Activity Creator extension using .Net Core 6, when trying to install the nuget in Studio, the following error appears:

System.IO.FileNotFoundException: Could not load file or assembly 'System.Activities, Version=6.0.3.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

File name: 'System.Activities, Version=6.0.3.0, Culture=neutral, PublicKeyToken=null'

at System.Reflection.RuntimeAssembly.GetExportedTypes()

at UiPath.Studio.Plugin.Workflow.Services.AssemblyContainerBase.AddAssemblyInternal(Assembly assembly, String path)

at UiPath.Studio.Plugin.Workflow.Services.AssemblyContainerBase.<>c__DisplayClass12_0.<ProcessAssemblies>b__0(Tuple`2 range)

Resolution:

  1. In the project in Visual Studio, select the .csproj file in the Solution Explorer ( Double-click it to have it show up in the edit pane)
  2. Once in Edit mode, find the section for PackageReference
  3. Find the UiPath.Workflow.Runtime change the version
  4. Either use a wildcard and change it to "6.0.0-*" or to the version currently in user as per the information in the UiPath.Workflow.Runtime
  5. On the Versions tab, select the latest version and use that value
  6. Save the project and it should refresh the package dependencies respective to that new version.