The Type Initializer for 'UiPath.NuGet.UiPathUtils' threw an Exception

How to troubleshoot error "The type initializer for 'UiPath.NuGet.UiPathUtils' threw an exception" when running a Robot from Orchestrator?

Error - "The type initializer for 'UiPath.NuGet.UiPathUtils' threw an exception" when running a Robot from Orchestrator.

Steps to be taken

  • Check the format of Nuget.config in System32 folder in path C:\Windows\System32\config\systemprofile\AppData\Roaming\NuGet which should be as below

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
</configuration>

 

  • If the NuGet.Config file is not available in System32 folder, it will be available in SysWOW64 folder:
C:\Windows\SysWOW64\config\systemprofile\AppData\Roaming\NuGet