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.
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.
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.
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.