Try our conversational search powered by Generative AI!

Commerce 14 (.Net 5) - Making Product property [CulturueSpecific] issue


I've implemented a custom Product class that inherits from EPiServer.Commerce.Catalog.ContentTypes.ProductContent.

    public class Product : EPiServer.Commerce.Catalog.ContentTypes.ProductContent
          //My custom properties

I have previously implemented a property which was not culture specific.

        [Display(Name = "Keywords")]
        public virtual string Keywords { get; set; }

A few days later I've realised that this property should be culture specific so I've added a [CultureSpecifc] attribute to it

        [Display(Name = "Keywords"]
        public virtual string Keywords { get; set; }

Currently I have no products at all in my commerce catalog, however, after performing this change I get the following Exception during site initialization:

InnerException	{"The property 'Keywords' was found on multiple content types, but with different attribute CultureSpecific values.To ignore those mismatches, add a setting with name \"episerver.commerce:IgnorePropertyAndMetafieldMisMatch\", and value to true. However, proceed with caution! "}	System.Exception {System.InvalidOperationException}

Is there any way to force a property that already has been created to become CultureSpecific?


Mar 11, 2022 15:28

I think I might've found the cause, I had different ContentType type (Variation) which also had a Keywords property. Making it have a different name seems to solve the issue somehow.

Mar 11, 2022 15:34

Yes exactly. Glad you fixed your issue, but the error message could be better (I wrote it actually). I will take a look on how to improve it.

Mar 11, 2022 16:14

Yeah, it took me a while before I understood what the error message was actually trying to say. It would very helpful if the error message could say specifically which content types that have the issue.

Mar 14, 2022 6:56

I looked into it, and unfortunately changing the log message to be more helpful would be not trivial. I completely agree that it should be more informative, but we'll have to live with it for now 

Mar 14, 2022 11:34
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.