Creating Custom Activity via NugetPackge which also uses a NugetPakage itself

Hi everyone,
Hope you all are doing well. I’m new to RPA
I’m using UiPath community version(not legacy) and dotnet 6.0
I’m trying to create a CustomActivity to perform Sqlite Database operations. My Class Library is using nuget package System.Data.Sqlite , I’ve created the package successfully, also tested it with a simple c# console project(which is working fine)
when I add my package to UiPath and try to run the activity, it is throwing error as below

My Solution Explorer is like this
image
I was also getting error previously ‘Could not load file or assembly System.Data.Sqlite’ , so I added System.Data.Sqlite.dll as well in the nuget package as below
image

Kindly correct me if I’m doing anything wrong
Thanks in advance.

@Muhammad_Umair_Malik

Can you please cross verify here …i fyou followed properly

Cheers

Do the existing database activities from UiPath not cover your use case? I do not think you need to make custom activities.

Thanks @Anil_G ,
Actually I used the old method i.e., creating class library c# project, and make package using Nuget Package Explorer
I followed this link to create package.

Also, If a do not use System.Data.Sqlite in my custom activity then everything goes fine.

Thank @Jon_Smith ,
yes I first tried to use built-in activities but found hard to make it dynamic as I wanted to only pass the connection string to dynamically connect to my Sqlite Database
Therefore I preferred to create Custom Activity
Also my custom activity works fine when I do not include any third party nuget package in it.

The Database activities have a connection string object you can create dynamically?
What part did you struggle with?

It also has a required parameter named “Provider name”
I do not know how to handle it to make it dynamic

Hahaha, that is much easier than creating a custom activity!

Maybe make a new topic and ask that?

Sure, Thanks for your reply

Hey @Muhammad_Umair_Malik, could this be because your connection string is “hello world”?

Thanks @Jacqui_M,
I wish it would be :sweat_smile:, but it’s not the issue, I tried with passing the right connection string.
Also in case of wrong connection string, SQLite throws proper relevant exception (I tried that too)

I found the problem,
Actually my Custom Activity project was building on x64 bit target platform, but the third-party sqlite library which I was using was for 32bit applications
This was the main issue, so I first download a 64bit System.Data.Sqlite.dll file(you can find it easily from dllme)
Then I created a nuget Package for that 64bit dll, and add it into my project as well as in UiPath dependencies
So that I don’t have to include System.Data.Sqlite in my own package.
Now it’s working fine
Thanks to @all . :innocent:

1 Like

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