Unable to serialize instance of System.IO.DirectoryInfo

In the beginning of my job, created by REF, I initialized a variable of type System.IO.DirectoryInfo via

Directory.CreateDirectory(“O:\CS\CSI\IF\008_RPA_BOT-DEVELOPMENT!DevCopy_Environment\DevCopy_006-Payee Control Reminders_Prozess-Output\RuntimeData\2024_09_10”)
.

After doing several subsequences, I want to pass this DP to my last subsequence, but every debug run fails with this exception

07_Finish - Invoke Workflow File (Sequences\07_Finish.xaml): Unable to serialize instance of ‘System.IO.DirectoryInfo’.

The path itself and all information from DirectoryInfo are correct and double checked. Can some please give me an explenation to this behavior?

@christian.helbing.senn,

It’s because passing unserializable datatype variable is not supported by Invoke workflow file activity.

Thanks,
Ashok :slightly_smiling_face:

1 Like

@christian.helbing.senn

Welcome to the community

instead you can create it with a global variable scope which can be accessed in any xaml wihtout passing

cheers