Deployment to UiPath Studio - rpapub/WatchfulAnvil GitHub Wiki

Caution

Content needs proof-reading.

Deploying and Testing Custom UiPath Studio Workflow Analyzer Rules

There are two ways to deploy custom rules to UiPath Studio. The first method is to copy the .dll files to the appropriate folders in the UiPath Studio installation directory. The second method is to create a NuGet package and publish it to a local or networked NuGet feed. Both have advantages and disadvantages.

The first method is the most straightforward and is suitable for quick testing and development, but requires Windows Explorer access to the installation directory. It is also less robust, as it does not allow for easy versioning or distribution of the custom rules. It is however the installation-wide solution, meaning that all users and all projects of the UiPath Studio installation will have access to the custom rules.

The second method, creating a NuGet package, is more complex but allows for easier distribution and versioning of the custom rules. It also allows for easier testing and deployment in different environments. But with nupkg files being a dependency on a per-project basis, it means that only one project has access to these custom rules. This method is not recommended for production deployment because dependencies for the static code analysis have no justification to be present in a production package.

Deploying Custom Rules as DLL Files in UiPath Studio

To ensure your custom UiPath Studio Workflow Analyzer rules dll files are correctly deployed and detected, follow these steps. The deployment process depends on your UiPath Studio version, the installation mode, and the project type you are working with (i.e., legacy or Windows projects).

These instructions document the deployment of both legacy and Windows projects, as the maintenance of "legacy" projects is still a requirement for many organizations.

Identifying Your UiPath Studio Version and Installation Mode

Important

Placing the dll files in the correct folder is essential for the rule to show up in the Workflow Analyzer settings.

Identifying UiPath Studio Version

To identify the UiPath Studio version:

  1. Open UiPath Studio.
  2. Go to Help under the Settings menu.
  3. The Studio Version will be displayed there. Note the version for reference.

Identifying Installation Mode (User or System)

You need to know whether UiPath Studio is installed in user mode or system mode. Here’s how to identify the installation mode:

  1. For System Mode: The installation is done for all users on the machine and typically resides in C:\Program Files\UiPath\Studio\.

  2. For User Mode: The installation is for the current user only and typically resides in C:\Users\<YourUsername>\AppData\Local\Programs\UiPath\Studio\.

You can verify the installation mode by checking where UiPath Studio is installed:

  • System Mode: Installed in C:\Program Files\UiPath\Studio\
  • User Mode: Installed in C:\Users\<YourUsername>\AppData\Local\Programs\UiPath\Studio\

Understanding DLL Differences by Project Type

UiPath Studio supports two types of projects:

  • Legacy Projects: These projects target .NET Framework 4.6.1 (net461).
  • Windows Projects: These projects target .NET 6.0 (net6.0).

The Workflow Analyzer will use different sets of rules based on the project type:

  • For Legacy Projects (net461): The analyzer will use the .dll compiled for .NET Framework 4.6.1 (net461).

  • For Windows Projects (net6.0): The analyzer will use the .dll compiled for .NET 6.0 (net6.0).

This distinction is important because depending on the project type, UiPath Studio will invoke different custom rules for analysis.

Deploying Custom Rules by Studio Version and Project Type

Once you've identified your UiPath Studio version, installation mode, and project type, you can deploy your custom rules .dll file to the appropriate folder.

Here are the instructions for

  • UiPath Studio Version ≥ 2024.10
  • UiPath Studio Version between 2021.10 and <2024.10
  • UiPath Studio Version < 2021.10

Deployment for UiPath Studio ≥ 2024.10

For UiPath Studio version 2024.10 and newer:

  • Target Folders:

    • System Mode:
      %ProgramFiles%\UiPath\Studio\Rules\net8.0
      
    • User Mode:
      %LocalAppData%\Programs\UiPath\Studio\Rules\net8.0
      
  • DLL to Install:

    • Prepare to install the .dll file for net8.0: C:\Users\<username>\Source\Repos\github.com\rpapub\WatchfulAnvil\src\HelloWorld.WorkflowAnalyzerRules\bin\Debug\net8.0\HelloWorld.WorkflowAnalyzerRules.dll

Deployment for UiPath Studio 2021.10 to <2024.10

For UiPath Studio versions between 2021.10 and before 2024.10:

  • For Legacy Projects (net461):

    • Target Folders:

      • System Mode:
        %ProgramFiles%\UiPath\Studio\net461\Rules
        
      • User Mode:
        %LocalAppData%\Programs\UiPath\Studio\net461\Rules
        
    • DLL to Install:

      • Prepare to install the .dll file for net461: C:\Users\<username>\Source\Repos\github.com\rpapub\WatchfulAnvil\src\HelloWorld.WorkflowAnalyzerRules\bin\Debug\net461\HelloWorld.WorkflowAnalyzerRules.dll
  • For Windows Projects (net6.0):

    • Target Folders:

      • System Mode:
        %ProgramFiles%\UiPath\Studio\Rules\net6.0
        
      • User Mode:
        %LocalAppData%\Programs\UiPath\Studio\Rules\net6.0
        
    • DLL to Install:

      • Prepare to install the .dll file for net6.0: C:\Users\<username>\Source\Repos\github.com\rpapub\WatchfulAnvil\src\HelloWorld.WorkflowAnalyzerRules\bin\Debug\net6.0\HelloWorld.WorkflowAnalyzerRules.dll

Deployment for UiPath Studio < 2021.10

For UiPath Studio versions before 2021.10:

  • For Legacy Projects (net461):
    • Target Folders:

      • System Mode:
        %ProgramFiles%\UiPath\Studio\Rules
        
      • User Mode:
        %LocalAppData%\Programs\UiPath\Studio\Rules
        
    • DLL to Install:

      • Prepare to install the .dll file for net461: C:\Users\<username>\Source\Repos\github.com\rpapub\WatchfulAnvil\src\HelloWorld.WorkflowAnalyzerRules\bin\Debug\net461\HelloWorld.WorkflowAnalyzerRules.dll

Copying the .DLL File to the Correct Folder

After identifying your version, mode, and project type, copy the correct .dll file to the appropriate folder:

  1. For UiPath Studio Version ≥ 2024.10:
  • System Mode: Copy the .dll file
    • from C:\Users\<username>\Source\Repos\github.com\rpapub\WatchfulAnvil\src\HelloWorld.WorkflowAnalyzerRules\bin\Debug\net8.0\HelloWorld.WorkflowAnalyzerRules.dll
    • to %ProgramFiles%\UiPath\Studio\Rules\net8.0.
  • User Mode: Copy the .dll file
    • from C:\Users\<username>\Source\Repos\github.com\rpapub\WatchfulAnvil\src\HelloWorld.WorkflowAnalyzerRules\bin\Debug\net8.0\HelloWorld.WorkflowAnalyzerRules.dll
    • to %LocalAppData%\Programs\UiPath\Studio\Rules\net8.0.
  1. For UiPath Studio Version 2021.10 - 2024.9:
  • For net461 (Legacy Project):
    • System Mode: Copy the .dll
      • from C:\Users\<username>\Source\Repos\github.com\rpapub\WatchfulAnvil\src\HelloWorld.WorkflowAnalyzerRules\bin\Debug\net461\HelloWorld.WorkflowAnalyzerRules.dll
      • to %ProgramFiles%\UiPath\Studio\net461\Rules.
    • User Mode: Copy the .dll
      • from C:\Users\<username>\Source\Repos\github.com\rpapub\WatchfulAnvil\src\HelloWorld.WorkflowAnalyzerRules\bin\Debug\net461\HelloWorld.WorkflowAnalyzerRules.dll
      • to %LocalAppData%\Programs\UiPath\Studio\net461\Rules.
  • For net6.0 (Windows Project):
    • System Mode: Copy the .dll
      • from C:\Users\<username>\Source\Repos\github.com\rpapub\WatchfulAnvil\src\HelloWorld.WorkflowAnalyzerRules\bin\Debug\net6.0\HelloWorld.WorkflowAnalyzerRules.dll
      • to %ProgramFiles%\UiPath\Studio\Rules\net6.0.
    • User Mode: Copy the .dll
      • from C:\Users\<username>\Source\Repos\github.com\rpapub\WatchfulAnvil\src\HelloWorld.WorkflowAnalyzerRules\bin\Debug\net6.0\HelloWorld.WorkflowAnalyzerRules.dll
      • to %LocalAppData%\Programs\UiPath\Studio\Rules\net6.0.

Verifying Rule Deployment in UiPath Studio

  1. Open UiPath Studio.
  2. Open a project for each project type "legacy" and "Windows".
  3. Open the Workflow Analyzer to verify that the custom rules are visible. Expected behavior is: HWR-SAMPLE-001 is shown in the Workflow Analyzer. Verify UiPath Studio Workflow Analyzer loading HelloWorldRule

Result of Rule Deployment

  • If the custom rules are detected in UiPath Studio, the development environment is set up for own custom rules development.

Deploying Custom Rules as a nupkg Package in UiPath Studio

To ensure your custom UiPath Studio Workflow Analyzer rules nupkg package is correctly detected, follow these steps. As the nupkg package contains dll files for all targetFrameworks, it is not necessary to deploy the dll files separately. The deployment process only requires one nupkg package to be deployed.

Publishing the Custom Rules as a NuGet Package

The custom rules need to be packaged into a NuGet package, which can be consumed by UiPath Studio. To do this:

  • Publish the NuGet Package Locally: To make the custom rules available for UiPath Studio, the next step is to publish the .nupkg file to a local or networked NuGet feed. You can do this by creating a local NuGet feed and pointing UiPath Studio to it.
  • Use the nupkg package: C:\Users\<username>\Source\Repos\github.com\rpapub\WatchfulAnvil\src\HelloWorld.WorkflowAnalyzerRules\bin\Debug\HelloWorld.WorkflowAnalyzerRules.0.1.0-alpha.nupkg

Configuring UiPath Studio to Use the Local Package Feed

Once the custom rules are packaged into a NuGet file and the feed is created, the next step is to configure UiPath Studio to access this local feed.

  • Open UiPath Studio.
  • Navigate to Manage Packages under the Home tab.
  • In the Package Manager, go to the Settings tab.
  • Click the + icon to add a new package source.
  • Set the Name to something descriptive (e.g., Local Custom Rules) and point the Source to the folder where your .nupkg file is located (e.g., C:\LocalNuGetFeed).

Installing the Custom Rules in UiPath Studio

After setting up the package feed:

  • Open the Manage Packages window again in UiPath Studio.
  • Under the Available Packages tab, select the Local Custom Rules feed.
  • Search for your custom rule package (e.g., HelloWorld.WorkflowAnalyzerRules), then click Install.
  • The custom rules will now be available for use in UiPath Studio.

Testing the Custom Rules in UiPath Studio

To verify that the custom rules are detected and applied correctly in UiPath Studio:

  1. Open UiPath Studio.
  2. Open a project for each project type "legacy" and "Windows".
  3. Open the Workflow Analyzer to verify that the custom rules are visible.

Result of NuGet Deployment

  • If the custom rules are detected in UiPath Studio, the development environment is set up for own custom rules development.
⚠️ **GitHub.com Fallback** ⚠️