How To Troubleshoot Error " Unexpected Error Has Occurred During The Library Compilation Process"?

How to fix the error "Unexpected error has occurred during the library compilation process" that appeared when tried to publish a process into Orchestrator? After converting a Studio process, this error is thrown when tried to publish it: Unexpected error has occurred during the library compilation process: System.AggregateException: One or more errors occurred.

Issue Description: This error can come during the execution or publishing of a process from UiPath Studio, UiPath CLI or other CI/CD pipelines.
The error has the same initial message “Unexpected error has occurred during the library compilation process”, but it is always followed by lines that make it specific and point to where the issue might be.

This article does not provide an exhaustive list of all the possible specific error messages, but a list of the most commonly occurring errors and troubleshooting advice on how to solve it (regardless of the specificity of the error).


Root Causes:

  1. Package dependencies are not resolved (appear as red in the project panel instead of blue), or they have unresolved sub-dependencies (they appear as a gray shade, instead of blue).
  2. After converting a process from Windows-Legacy to Windows, some namespaces are not imported.
  3. Converting processes from Windows-Legacy to Windows, but not converting the custom libraries used as dependencies
  4. Not migrating to .Net 6 the custom activities created in Microsoft Visual Studio and that are used in a project
  5. Using activity packages that are incompatible with your project type

Resolution Approaches:
  1. Resolve any dependency from the Project panel before running or publishing the process. Right click on the dependency and choose "Repair dependency". Read more on the Managing dependencies
  2. Make sure to use the latest-deployed version of the activity packages or the one compatible with your UiPath Studio version, as per the information panel of each activity package.
  3. If a namespace is missing, the error will indicate which one. Import it into the project. More instructions on that, on the Managing Namespaces
  4. Convert to Windows any custom-made library that you plan to use in a Windows process. Take into account the requirements and limitations of using libraries, as per the About Libraries
  5. Migrate your custom-made activities to .Net 6 before using them in a Windows project. More instructions on that, on the Migrating activities to .Net 6
  6. Before adding an activity dependency package, verify the documentation page of it and ensure it is compatible with the type of project planned to use it in.


Edge scenarios:
Error examples:

Unexpected error has occurred during the library compilation process:
System.AggregateException: One or more errors occurred. ---> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary

Unexpected error has occurred during the library compilation process:
Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)uipcli.exe Error: 0 : Unexpected error has occurred during the library compilation process.