What would be a lasting solution for the COM exception issue that occurs after a system restart and is temporarily fixed by removing packages from the user profile?
Issue Description: The error "Retrieving the COM class factory for component with CLSID {XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E+CLASSNOTREG))" is linked to a faulty COM component registration in UiPath. If a non-persistent user profile is utilized on the machine, each system restart removes files, causing corruption in the dependencies as they copy over to the Packages folder.
Root Cause:
This problem arises when the User Profile isn't persistent, causing files to be deleted and recopied to the Packages folder every time the machine reboots, which leads to dependencies corruption.
Resolutions:
Temporary Solution: A short-term fix is to delete the packages folder located by default at %userprofile%\.nuget\packages after every system restart, allowing the dependencies to reinstall.
Permanent Solution: To prevent this issue from reoccurring, consider redirecting the packages installation folder to a persistent drive, such as a folder in the system drive (C:). Follow the below steps(also available here):
-
By default, activities packages are downloaded and installed in the
%userprofile%\.nuget\packages
folder. You can set a different folder in one of the following ways: - During installation, by installing from the command line with the option
PACKAGES_FOLDER
. - After installation, by manually editing the
uipath.config
file:- Open the
uipath.config
file in a text editor. By default, the file is located inC:\Program Files\UiPath\Studio
. - In the
packageSettings
node, add thepackagesInstallationFolder
key with the path to the new folder as its value. -
Save the changes and, if the Robot is installed as a service, restart the service.
For example, add the following touipath.config
to change the download location toC:\nuget
.
- Open the
With this change, your packages should now install in a persistent location, reducing the likelihood of a reoccurrence of this error.