XmlDocument Support
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:
- 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.Xml
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.Xml.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.Xml