AsEnumerable Support

Updated by Luka Koczorowski

AsEnumerable is a DataTable extension and does not come from the standard DataTable class. UiPath automatically includes this extension and therefore it appears seamless however, in PAD we have to explicitly reference the assembly containing this extension.

The assembly of interest is System.Data.DataSetExtensions.dll. This assembly is standard with .NET

Our strong recommendation is to download the standard .NET developer pack directly from Microsoft which includes all .NET assemblies. It will resolve this issue and any potential future missing references (For example. Taking screenshots from UiPath)

Steps to follow:

  1. Download .NET dev pack: https://dotnet.microsoft.com/en-us/download/dotnet-framework/thank-you/net472-developer-pack-offline-installer
  2. This will install .NET assemblies to C:\Program Files (x86)\Reference Assemblies\
  3. Delete or move System.EnterpriseServices files from assembly folder as PAD is unable to load these files.
  4. In Init_Variables, set  %defaultRunDotNetScriptReferences% to  C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2
  5. In Init_Variables, set %defaultRunDotNetScriptImports% to System.Data.DataSetExtensions

 

If you’re unable to download the dev pack, a less robust solution is the following:

  1. Create a custom-module folder wherever you like. We recommend in PAD installation folder.
  2. Search the filesystem for System.Data.DataSetExtensions.dll
  3. Copy this file into your custom-modules folder.
  4. In Init_Variables, set %defaultRunDotNetScriptReferences% to  C:\path\to\my\custom-modules
  5. In Init_Variables, set %defaultRunDotNetScriptImports% to System.Data.DataSetExtensions


How did we do?