What is recommended way to replace modified code activity nuget package

Hi, Apologies for long and wordy topic. But it was inevitable.

Actual question : How to replace a Nuget Package in UiPath workflow when there is code change in code activity inside referred nuget package?

Suppose I am having a NuGet package CustomPackageV1.Activties (CustomPackageV1.Actvities. referred in my workflow as a custom activity. This CustomPackageV1.Activities is made of CustomCodeActvity.dll.
Now suppose there is code change happened in CustomCodeActvity.dll.
What is the recommended way of replacing CustomPackage (CustomPackageV1.Actvities. referred in my UiPath Workflow so that new CustomActivity.dll is correctly referred?

I was facing kind of caching issue in doing this. So I am doing through a long way like :

  1. Delete Custom activity reference from my workflow.
  2. Uninstall CustomPackageV1.Actvities activity Nuget package
  3. Delete CustomPackage source from “Manage Packages” dialog box. (Say C:\Demo\MyCustompackages)
  4. Create brand new CustomPackage source from “Manage Packages” dialog box. (Say C:\Demo\MyCustompackages_New)
  5. Through NuGet package Explorer, create new Nuget package (CustomPackageV2.Actvities. for modified CustomActivity.dll and place it in newly created custom package source i.e. C:\Demo\MyCustompackages_New
  6. Now I am able to get new functionality in my workflow.

If I don;t do above steps, I get old functionality only. Kind of caching issue.

So again my question is: what is recommended way to replace modified code activity nuget package

1 Like

Sadly, vendor’s staff still hasn’t offered help with this super annoying issue.

To anyone whom this may still concern: 4 steps to clear package cache.

  1. With UiPath Studio running, remove the installed package(s) that contains the custom activity with the Manage Packages tool. Close UiPath.
  2. Create a new package with NuGet Package Manager.
  3. Copy newly created .nupkg file into UiPath Packages folder, typically C:\Program Files (x86)\UiPath\Studio\Packages.
  4. Copy the entire Nuget output directory, i.e. the folder that contains your custom .nupkg file and its related ‘lib’ subfolder with a .dll file, into UiPath activity local appdata directory, typically C:\Users\{username}\AppData\Local\UiPath\Activities.
  5. Delete the cached package directory in local appdata nuget temp folder, typically C:\Users\{username}\AppData\Local\Temp\nuget\{customPackageName}.
  6. Start UiPath Studio, start the project that references the custom package and you’ll have your updated code available.

About step 3: Technically, you could skip this step, because the package will become installed in step 4. Only difference would be if you ever uninstalled the package via UiPath Package Manager, in which case you couldn’t reinstall it right away, because UiPath looks for installable local packages under package directory in Program Files.

About step 4: Completing this step will automatically have the package installed the next time you start UiPath. If you’ll rather install the package manually via Package Manager, skip this step (but do remember to complete step 3 !).

1 Like