The type or namespace name 'Xml' does not exist in the namespace 'System.Security.Cryptography'

Hello everyone,
I’m invoking c# code in UiPath v22.10.5. The code involves generation of the digital certificate using the X509 certificate where i am referring the xml file path as an input.

The namespaces involved and imported in UiPath are shown below:

using System;
using System.Security.Cryptography.X509Certificates;
using System.Xml;
using System.Security.Cryptography.Xml;
using System.IO;

Further, while defining the variable, i m explicitly adding the full namespace (as partial throwing an error). Screenshot attached for the reference.

var sXml = new System.Security.Cryptography.Xml.SignedXml(doc);

I am still getting an error while executing the Invoke code activity in UiPath as “The type or namespace name ‘Xml’ does not exist in the namespace 'System.Security.Cryptography” for the above line.

Could someone confirm us the cause of the issue. Thank you in advance!

Hi @chirag.joban05

Is it possible to upgrade the studio to 24.10.6 version or 23.10.5?

Regards
Sonali

@chirag.joban05

Close the XAML
Close UiPath / Project
Take a backup from the XAML
Open the XAML within a text editor (e.g. notpad++)
Add the Assembly reference in case of it is missing:
grafik
<AssemblyReference>System.Security.Cryptography.Xml</AssemblyReference>

Save the file
Open studio and try again. Now the Class and namespace should be recognized

Maybe do the same for <AssemblyReference>System.Security.Cryptography</AssemblyReference>

and ensure that the invoke code is correct and do not use unneeded / unsupported statements