System.Runtime.Serialization in UWP 10

0

I'm creating an exception in UWP , however, it seems like UWP apps do not have the same features for serialization as classic applications. The code below does not work for UWP .

using System;
using System.Runtime.Serialization;

namespace CustomExceptions
{
    [Serializable]
    public class InvalidCpfException : Exception
    {
        public InvalidCpfException ( ) { }
        public InvalidCpfException ( string message ) : base(message) { }
        public InvalidCpfException ( string message, Exception inner ) : base(message, inner) { }
        protected InvalidCpfException ( SerializationInfo info, StreamingContext context ) : base(info, context) { }
    }
}

It seems that there is no attribute [Serializable] and type SerializationInfo . How to ensure exception serialization in UWP ?

    
asked by anonymous 23.12.2016 / 01:12

0 answers