AsEnumerable Support
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:
- Download .NET dev pack: https://dotnet.microsoft.com/en-us/download/dotnet-framework/thank-you/net472-developer-pack-offline-installer
- This will install .NET assemblies to C:\Program Files (x86)\Reference Assemblies\
- Delete or move System.EnterpriseServices files from assembly folder as PAD is unable to load these files.
- In Init_Variables, set %defaultRunDotNetScriptReferences% to C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2
- 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:
- Create a custom-module folder wherever you like. We recommend in PAD installation folder.
- Search the filesystem for System.Data.DataSetExtensions.dll
- Copy this file into your custom-modules folder.
- In Init_Variables, set %defaultRunDotNetScriptReferences% to C:\path\to\my\custom-modules
- In Init_Variables, set %defaultRunDotNetScriptImports% to System.Data.DataSetExtensions