I am porting a .NET Framework C# class library to a Portable Class Library. One recurring problem is how to deal with classes decorated with the [Serializable]
One thing you could do to eliminate the clutter that the constant preprocessor directives causes is to push that off to one new SerializableAttribute class and basically trick the compiler.
#if PORTABLE
namespace System
{
public class SerializableAttribute : Attribute
{
//this does nothing
}
}
#endif
Then just continue to decorate your classes with Serializable as normal...