How to create custom activity that include only worked in x64 dll

Hi all, I just create a custom activity in vs, I import the third party dll that only worked in x64, if I don’t change the activity project build model, that activity will pop the error “Could not load file or assembly ‘CustomActivity, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. An attempt was made to load a program with an incorrect format.”; if I modify the activity project build model to x64, then I can’t see the custom activity in activities panel. So how to create activity that can import the x64 dll?

Check this possible solution Windows Compatibility Mode still not showing Custom Activities - #5 by StefanSchnell

1 Like

I check that document, but it is not the same as that, please check below screenshot, I can install my custom activity and can drag my custom activity to my process, it will pop the error when I run the process.


From the provided screenshots, I see that your custom activity ‘can’ work only with Windows-legacy projects in UiPath Studio due to the net461 folder in lib.

Check if you can add the rest of the missing folders and then in dependencies to have something like:

For UiPath Studio >=2021.10.6, you should use <group targetFramework="net6.0-windows7.0" />

Example:

The same information should be added in the .nuspec file.

Example for uipath.ftp.activities.nuspec

More details you will find here Migrating Activities to .NET 6


Project compatibility in UiPath Studio:

Windows-Legacy → it is a 32-bit Windows executable XAML. Uses .NET Framework 4.6.1. the compatibility used in releases prior to 2021.10. This is the default option.

Windows → it is a 64-bit Windows executable XAML. Uses .NET 6 (in Studio 2021.10.6 and later versions) or .NET 5 (in Studio 2021.10 versions prior to 2021.10.6) with Windows support.

Cross - Platform → it is a 64-bit Windows executable XAML with no platform dependency (will run on Windows 64-bit and Linux 64-bit). Uses .NET 6 (in Studio 2021.10.6 and later versions) or .NET 5 (in Studio 2021.10 versions prior to 2021.10.6) with cross-platform support.

More details can be found here About Automation Projects


Important note:

Studio 2022.10 will be the last release to support the creation of projects with the Windows-legacy compatibility. In Studio 2023.4, you will be able to create Windows or cross-platform projects, and only open and edit Windows-legacy projects created in previous versions of Studio. A migration tool will be available starting with Studio 2022.10 to allow you to convert Windows-legacy projects to the Windows compatibility.

Reference: Deprecation timeline

Hi Marian, thanks for your help, when I add the “System.Activity.dll” from the uipath folder, it will pop the error when build the project (check the below screenshot), do I miss any steps? is there any demo project or document?

The only information that we have is shared here:

Thanks, I will check that.

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