Loading ...

Fix: Type xx in Assembly xx is not marked as serializable | CodeAsp.Net

Fix: Type xx in Assembly xx is not marked as serializable

 /5
0 (0votes)

I added few properties in one of our Business classes in our application Communifire. I started getting the following error:

Type 'xxx' in Assembly 'ScheduleWidget, Version=2.2.0.0, Culture=neutral, PublicKeyToken=7df720a1c4851830' is not marked as serializable

 

I knew I didn't add [Serializable] attribute to new property which could have been the fix for this issue, but my requirement was different I didn't want the [Serializable] attribute. Therefore I made my property in this way:

[NonSerialized]
private Schedule _schedule;

public Schedule Schedule
{
get { return _schedule; }
set { _schedule = value; }
}

i.e after adding [NonSerialized]  attribute the issue was fixed

 

Comments (no comments yet)

Top Posts