I recently ran into a puzzling error trying to install a web manifest bundle that read something like:
Error installing model item Entity1.EntityProperty 1:M Entity2.EntityProperty (Entity ModelRelationshipsEntity1.Entity2.1fdkljhdsfhsdfpof34nf34k.xml) Object reference not set to an instance of an object.
I could not figure out what could be wrong, there were other relationships in the manifest that were not failing, so why this one?
After a lot of head scratching, a simple solution. The entity that the relationship was defined for was not in the system, nor in the manifest. Once I saw that the message was a little more obvious but it sure would be nice if the error stated “Unable to create relationship. Entity is missing” or something a little more friendly. So if you are installing a manifest and see an error on a relationship make sure you check to see that the entities being related to are in the manifest or are already in the system.