Trying to create code activity with NET 8.0; UiPath.Activites.Contracts unresolved

I’ve been working on generating an activity from code (C#) for some time now. I’ve got the basic functionality working and have been able to package, include and test this in UiPath Studio. I’ve been using this tutorial as a guide and example.

However, I’m having a problem implementing the design for the activity (the visual piece) described about halfway down that page. In the ViewModel I used:

public class MyCustomViewModel : DesignPropertiesViewModel

and found DesignPropertiesViewModel undefined.

I found a NuGet package that I thought would satisfy it, but it didn’t work. I’ve hosed up my project file now, as it’s stuck on “Could not find assembly UiPath.Activities.Contracts, Version 1.0 …” from a file named Microsoft.WinFX.targets. I can recreate the project, but I can’t get rid of this error in the current solution.

I’m using C# on Visual Studio 2022. I’m attempting to use NET 8.0, which may be my problem. The issues appear to be a disconnect between NET and .NET Framework 4.6.1, which is apparently still used by the Design Activity.

There doesn’t appear to be a real clear way to add a ViewModel to a NET 8.0 project (net8.0-windows). Should I start with a different source for the project? All I’m trying to do is create an input argument control for an already functional method so that UiPath Studio can render it.

Thank you in advance!

Hi @yosemitesam

I’m not very sure but you can try to use .NET Framework 4.6.1 (or 4.7.2) in Visual Studio for both the activity and the design project.

Happy Automation

Thanks for your reply, but I’m attempting to implement a UiPath-supplied solution that specifically supports using NET, albeit NET6.0. I was hoping I could port it to NET8.0. It’s a published project, available at a GitHub repo owned by UiPath.

It’s supposed to work, at least in NET6.0. It does not. Even in 6.0, when you attempt to define a method with a signature that UiPath’s article directly references, it fails.

There is no System.Activities.DesignViewModels assembly available for NET6.0. This breaks the entire project.

I really don’t want to implement something in 2025 that requires .NET Framework.

Hello @yosemitesam,

I think that in order to make it work, the following steps are needed:

  • remove references to “UiPath.Activities.Contracts” (not used)
  • add reference to “System.Activities.ViewModels” (1.0.0-20250625.2 is the latest available)
  • add reference to UiPath.Workflow (version 6.0.0-20240401-07)
  • add reference to UiPath.Activities.Api (version 24.10.1) if needed

I hope the above steps solves the problem.

Regards,
Viorel

Thanks for your comment, Viorel. Unfortunately, after taking these steps I still have exactly the same problem.

None of the included packages are referenced by the class, and none of the “Design” components can be found in the project.

Can you also include at the beginning of the file (You are not using this namespace).
using System.Activities.DesignViewModels;

Or can you share the project here?
@yosemitesam

System.Activites.DesignViewModels does not exist in this project. That’s the whole problem (see above). It can’t be resolved and isn’t available as a NuGet package.

The project is available in a link I shared in the original post. It’s from a tutorial posted on docs.uipath.com. Hence my dismay about it not actually working as published.

I made a little more progress since yesterday after finding this topic on a similar subject. Though based on other responses there I still wonder if this is going to work.

We’ll see.

The project sample has been updated (Community.Activities/Activities/Examples at develop · UiPath/Community.Activities · GitHub)
Also do you have this feed added https://pkgs.dev.azure.com/uipath/Public.Feeds/_packaging/UiPath-Official/nuget/v3/index.json
Can you try with the latest source if the problem persists?

I was finally able to get something working with Code Activities under .net8. Thank you for your help here, which got me over the last major hurdles. Also, finding this topic discussing the template and its use was a big help.

I do have some more questions, but will ask them under more appropriate headings. I’m finding it difficult to get good information on producing code libraries, among other things, regarding developing and extending UiPath functionality. Things have changed a lot over the years, and it’s hard to filter out information that’s old and/or not relevant to the modern methodology.

Thanks again,

– Sam

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