I've been struggling with an exception while I'm trying to import the package to one of the websites -
This has been due to the plugin installed - https://github.com/Geta/EpiCategories
So it's expecting a ContentType named 'CategoryData' which in my case I've two/category -
public class PressCategory : CategoryData
public class GuestReportingCategory : CategoryData
And the block has a property that basically overrides the default Category of page/block
Any idea what may have happened?
You might want to create a hotfix around this issue like this not explained well on Geta's plugin document here - https://github.com/Geta/EpiCategories
So I can guess from the error you received above is that it is searching for a registered contentType "CategoryData" which it cannot find in the system.
So you can use the base class from EPiServer.Core.StandardContentBase that will do the rest for you. It'll will register CategoryData as a ContentType.
public class CategoryData:StandardContentBase
However, If you look into the definition of inherited CategoryData base class (on your code) you will note that it exactly inherit the StandardContentBase but the keynote here is to decorate it with [ContentType] attribute. Which was missing in the original document.
Hey Ravindra, You nailed it! Thanks for putting your efforts.
I am glad to know that this helps
Out of curiosity, did you import content into a site that doesn't have EpiCategories installed? If not, do you have a GUID specified (you always should) for your Category content types? I have never had these issues as long as content types match between exporting and importing site.
If EpiCategories was not installed on the target site, did you include content types in your export package? However, I don't see the point in exporting/importing content types between sites these days since they are defined in code.