Hi Damien,
Yes, this is a mismatch between the model's properties and the property definitions stored in the database. Unfortunately we can't get to the actual property which causes this, unless we decompile the EPiServer assembly and debug it. Usually this can be fixed in two ways:
1. Restart the IIS to trigger model synchronization again, this should fix the error in most cases.
2. If the IIS reset doesn't fix the issue, you can manually delete the content type and its associated properties from the database, and restart the site again (Do this only if there isn't any content of this type inside the database. If you have contents already created, you need a different method to keep the contents).
Use this script to identify the pkId of the content type:
SELECT * FROM tblContentType
Use this script to delete the content type and its property definitions:
DELETE FROM tblPropertyDefinition WHERE fkContentTypeID = <<your_content_type_pkId>> DELETE FROM tblContentTypeDefault WHERE fkContentTypeID = <<your_content_type_pkId>> DELETE FROM tblContentType WHERE pkID = <<your_content_type_pkId>>
Cheer
Our client has encountered a problem where they receive a null referene expection each time the application starts. Please find the exception below. Looking at the error you can see that this is happening in the ModelSync Initialisation module. It is then tripping up on the Property Definition Comparer.
So you'd hazard a guess that there's a mismatch between a property type in the model and what is defined in the database. This is the module that presumably updates the database with the page type definitions. Taking a high level approach we attempted to see if there were any suspicious page types or properties in the database that might have got tripped up. We also tried comparing the latest changes in the code to see if we could narrow it down that way. No luck.
So I started reflecting the code and could see there is a Load method which is loading the property from the DB that can potentially return null. This load property is then compared against the current one, without checking for null. This is the snippet from EPiServer.DataAbstraction.DefaultPropertyDefinitionRepository.Save
PropertyDefinition otherPropertyDefinition = this.Load(propertyDefinition.ID, false);
if (new PropertyDefinitionComparer().IsEqual(propertyDefinition, otherPropertyDefinition))
{
return;
}
Somehow, we have a case where this module tries to load a property from the DB that it expects to be there. That's as far as I got though and can't seem to figure out wehre this propertyDefinition ID comes from in the first place.
Is this a known issue? Does anyone know how we could go about finding where this troubled property is?