Working with xConnect to save custom facet data, I started getting this error:
An unhandled exception of type ‘Sitecore.XConnect.Schema.XdbModelException’ occurred … The type of this instance does not correspond to any type in the model
Weirdly, the other 3 (nearly identical) facets worked just fine. Tracking down the issue was “fun”…
Digging through the XConnectClient object’s .Model property, I spotted a difference between the facet that wouldn’t work (top), and one that would (bottom):
The one that wouldn’t work doesn’t have a .ClrType . Well, it’ll need that. Nothing else seems to define the class to use. What would cause that?
Looking in my .config files, I found the relevant one – and it looks right…
… and then I noticed that it wasn’t being published. It did not appear in my Sitecore configuration (/sitecore/admin/showconfig.aspx), and it didn’t appear under the App_Config directory.
Fixed that, error went away. If you get this, check that your configuration for the facet is a) correct, and b) being deployed.