studio
latest
false
UiPath logo, featuring letters U and I in white

Studio User Guide

Last updated Jun 27, 2025

Troubleshooting

This page provides valuable insights and solutions to common issues encountered during the development and execution of coded automations.

Type X cannot be serialized

If your coded automation returns complex types that are not implemented in the coded interface, you will likely receive an error stating that a specific type cannot be serialized. Additionally, the error message recommends to mark the type with the DataContract attribute.

To solve this issue, follow these steps:

  1. Add the DataContract attribute to each class in the coded automation.
  2. Add the DataMember attribute to every property of the class.
  3. Manually import the System.Runtime.Serialization namespace: using System.Runtime.Serialization.
using System;
using System.Runtime.Serialization;
using System.Collections.Generic;
using System.Data;
using UiPath.Core;
using UiPath.Core.Activities.Storage;
using UiPath.MicrosoftOffice365.Activities.Api;
using UiPath.Orchestrator.Client.Models;

namespace ClassifyCalendarEvents
{
    [DataContract]
    public class Attendee
    {
        [DataMember] public string Email { get; set; }
        [DataMember] public string Name { get; set; }
        [DataMember] public string MeetingStatus { get; set; } // e.g., "Accepted", "Declined", "Tentative"
        [DataMember] public string Role { get; set; } // e.g., "Organizer", "Speaker", "Participant"
        [DataMember] public string Type { get; set; } // e.g., "Internal", "External"

        }
}using System;
using System.Runtime.Serialization;
using System.Collections.Generic;
using System.Data;
using UiPath.Core;
using UiPath.Core.Activities.Storage;
using UiPath.MicrosoftOffice365.Activities.Api;
using UiPath.Orchestrator.Client.Models;

namespace ClassifyCalendarEvents
{
    [DataContract]
    public class Attendee
    {
        [DataMember] public string Email { get; set; }
        [DataMember] public string Name { get; set; }
        [DataMember] public string MeetingStatus { get; set; } // e.g., "Accepted", "Declined", "Tentative"
        [DataMember] public string Role { get; set; } // e.g., "Organizer", "Speaker", "Participant"
        [DataMember] public string Type { get; set; } // e.g., "Internal", "External"

        }
}
  • Type X cannot be serialized

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2025 UiPath. All rights reserved.