Type 'Customer.Models.Blocks.FlashSizeOptions' could not be mapped to a PropertyDefinitionType

Vote:
 

Hi all,

In a block i have defined a property like this:

[Display(Order = 120, GroupName = TabNames.Information)]
[EditorDescriptor(EditorDescriptorType = typeof(EnumEditorDescriptor<FlashSizeOptions>))]
public virtual FlashSizeOptions FlashSize { get; set; }

 

The FlashSizeOptions enum looks like this:

public enum FlashSizeOptions
    {
        [Description("747x350")]
        Large,
        [Description("168x240")]
        Small
    }

    

and implemented the EnumEditorDescriptor class inhereting from EditorDescriptor

public class EnumEditorDescriptor<TEnum> : EditorDescriptor {...}

    

What makes this kind of wierd is that this worked for a while, but "just stopped working" It now gives me an exception saying

 Type 'Customer.Models.Blocks.FlashSizeOptions' could not be mapped to a PropertyDefinitionType
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: EPiServer.Core.TypeMismatchException: Type 'Customer.Models.Blocks.FlashSizeOptions' could not be mapped to a PropertyDefinitionType

    

Have anyone seen this before?

#73857
Aug 13, 2013 10:04
Vote:
 

The solution was to add a backing type for the property:

[BackingType(typeof(PropertyNumber))]

    

#73886
Aug 13, 2013 17:42
Vote:
 

Thank you for sharing the answer - saved me hours of research :-)

#75561
Sep 30, 2013 11:26
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.