I am unable to export custom activity to UiPath

Hi Everyone ,
I am finding difficulty in implementing custom activity to UiPath 2022.4.4.I have used VS community version 2022 and UiPath activity creator V4 for building custom activity. I am stuck with 3 challenges describing below

  1. I followed simple sum activity creation reference taken from DEMO: Build custom activities in minutes with the UiPath Activity Creator , While publishing the package instead of .nupkg file i am getting dlls,pdb and design files. attaching screenshot for reference also attaching publish settings of vs.



    I have noticed only Target framework is net6.0-windows is available but in official UiPath documentation it is net461 Activity creator document

  2. I have checked option in VS “generate nuget on built” , so i got nuget package from debug/bin folder . I have copied and placed correctly in UiPath manager package installation path. In manage packages .nupkg is not displaying to install.

3.Then I have tried nuget package explorer and exported .nupkg Migrating Activities to .NET 6
Now the package is displaying in manage packages in UiPath.however, installation is getting failed .
I pulled the log and found this error
"23:11:30.3148 => [ERROR] [UiPath.Studio.Project.exe] [15] System.IO.FileNotFoundException: Could not load file or assembly ‘System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The specified file cannot be found.
File name: ‘System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’
at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle typeInstantiationContext, RuntimeTypeHandle methodInstantiationContext)
at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type genericTypeArguments, Type genericMethodArguments)
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)
at System.Reflection.RuntimeAssembly.GetCustomAttributes(Type attributeType, Boolean inherit)
at System.Attribute.GetCustomAttributes(Assembly element, Boolean inherit)
at UiPath.Studio.Shared.Utilities.AssemblyLoaderUtils.TryLoadAssembly(IDictionary2 cache, IReadOnlyDictionary2 binAssemblies, String path, Assembly& assembly)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
"
Feel free to contribute and resolve the problem . Thanks!
Happy Automation !

Hi @rameespk23

Can you give a try installing the UiPath.Workflow.Runtime package before adding your project?

Also make sure that you’ve installed UiPath.Workflow.Runtime in your VS Project

Regards

Thanks for response
UiPath.Workflow.Runtime package is not displaying in manage packages , i manually downloaded nupkg from NuGet Gallery | UiPath.Workflow.Runtime 6.0.3 and pasted in packge installation path still this package is not displaying in manage packages

did you create a Windows project?

or is it a Windows - Legacy project?

@fernando_zuluaga It was windows-legacy

Hi @rameespk23 - Can you make sure all the check boxes were selected in the settings tab of Manage Packages

Yes it was selected already
image

@ushu what i observed is package published in .net6 version is not showing in manage packages all other packages are populating

I have noticed that custom activity is visible when i create project not in windows legacy mode, it displayed in windows mode . also package got installed .However, process run gets failed .

Unexpected error during the library compilation process:.
Unable to create Activity builder for Main.xaml. Reason: ‘No matching constructor found for type ‘System.Activities.Activity’. This type can be constructed using arguments or FactoryMethod directives. Default constructor not found for type ‘System.Activities.Activity’. This type can be constructed using arguments or FactoryMethod directives.’

1 Like

Hi @rameespk23

Re build your project in the lastest version, then create a windows project, install the UiPath.Workflow.Runtime package and then install your custom package, if the package install correctly it means that all by UiPath is doing correct, but if it fails when running then you should check your custom logic and code in VS and try to debug your project

Regards

@fernando_zuluaga , I just created new windows project instead of windows-legacy , Then the issue got resolved. I have installed the package and it is perfectly working. Thanks for your suggestions and support.

Note : when i install UiPath.Workflow.Runtime package it was throwing errors , i ran custom activity without UiPath.Workflow.Runtime package.

That’s a great new, remember to close the topic marking as solution helping each others find this solutions fastly

Regards

Sure, I will do !!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.