November Happy Hour will be moved to Thursday December 5th.

JSON serialization error when creating a link item.

Vote:
 

Hello,

I have a block with the following property:

[UIHint(SiteUIHints.ListArea)]
[Display(Order = 40, GroupName = SystemTabNames.Content, Name = "Link items",
Description = "Content area where link items can be placed.")]
public virtual LinkItemCollection Items { get; set; }

But when I create a link item on DXC I get the following error message:

Could not save property, and it has been reverted. Please try again.

Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'EPiServer.Core.ContentReference' because the type requires a JSON string value to deserialize correctly. To fix this error either change the JSON to a JSON string value or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object. Path '[0].text', line 1, position 9.

The thing is I don't get it on my local DEV machine, but I only get it on DXC. I redeployed my code to be sure the code on DXC is the same as the code on my development machine.

Does anybody have a clue?

#183064
Oct 04, 2017 9:40
Vote:
 

Did you change the property type which was previously a ContentReference Type?

Try renaming the property and then delete the unused property from the admin mode.

#183088
Oct 04, 2017 18:37
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.