XmlDocument Support

Updated by Luka Koczorowski

When working with UiPath selectors that are entirely generated at runtime either as a variable or expression, System.Xml namespace is required in order to parse the selector and convert it to a Power Automate selector at runtime. This is because under the covers UiPath selectors are encoded as an xml document. Because PAD only references a very limited set of namespace and assemblies by default, System.Xml has to be manually referenced. The assembly of interest is System.Xml.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.Xml

 

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.Xml.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.Xml


How did we do?