NuGet Architecture - Studio Perspective

What is NuGet?

NuGet is the package manager for .NET.

  • It is an essential tool for developers to create, share, and consume useful code. Often such code is bundled into "packages" that contain compiled code (as DLLs) along with other content needed in the projects that consume these packages.
  • NuGet client tools provide the ability to produce and consume packages. The NuGet Gallery is the central package repository used by all package authors and consumers.
  • For .NET (including .NET Core), the Microsoft-supported mechanism for sharing code is NuGet, which defines how packages for .NET are created, hosted, and consumed, and provides the tools for each of those roles
  • Put simply, a NuGet package is a single ZIP file with the .nupkg extension that contains compiled code (DLLs), other files related to that code, and a descriptive manifest that includes information like the package's version number


Flow of packages

This feature is inherited for the Activities and the Process management. The Studio uses the feeds configured in Package Manager. By default, it will have three feeds configured:

  • Orchestrator Tenant and Orchestrator Host - These activity feeds are added by default if the Robot is connected to Orchestrator and they cannot be disabled. The Orchestrator Tenant option is available only if the tenant libraries feed is enabled in Orchestrator. The feeds have the following source: https://[Orchestrator_host]/nuget/activities.
  • Local - The feed for the packages installed locally with Studio. The feed has the source: %ProgramFiles%\UiPath\Studio\Packages for per-machine installations or %localappdata%\Programs\UiPath\Studio\Packages for per-user installations.
  • Official - The official online UiPath® feed, where the activity packages that are officially supported by UiPath can be found. This feed has the following source: https://pkgs.dev.azure.com/uipath/Public.Feeds/_packaging/UiPath-Official/nuget/v3/index.json.
  • Marketplace - This public feed contains all the activities published on the UiPath Marketplace. Note that whether or not packages are built and officially supported by UiPath is specifically stated in the Manage Packages window, Package Information tab. This feed has the following source: https://gallery.uipath.com/api/v3/index.json.

These are loaded from Nuget.config which is available at the below location:

  • C:\Program Files (x86)\UiPath\Studio - for 32-bit Studio
  • C:\Program Files\UiPath\Studio - for 64-bit Studio
For example:
    
    
    
    
    
  

Note: Studio only accesses the feeds which are mentioned in the above config file.

As there is a difference in the NuGet versions that we have implemented in different versions of Studio/ Robots the activities/ process loads and install location are different in different versions of the product.

Activities Installation Mechanism:

  • When an activity is installed using the package manager it gets extracted into a specified folder based on the version the location can be different.

Studio (with NuGet 4) >= 18.3 Community & Enterprise

  • NuGet Cache: C:\Users\user\AppData\Local\NuGet\v3-cache
  • Activities extract and load location (restore location) C:\Users\user\.nuget\packages (if a job is started from Orchestrator or Tray also the processes are restored here)

Dependency Calculation:

  • All the packages that were installed while publishing the projects are considered listed as a dependency for that particular process.
  • If the packages are installed like excel, pdf, terminal and the associated activities have not been used, it will still be counted as dependencies.

Where we can see the dependency?
The .nupkg file contains the list of dependencies which can be seen via NuGet Package Explorer tool from Microsoft.

image.png


1 Like

2 posts were split to a new topic: Put nuget.config under source control