Jul 30, 2009 at 12:22 PM



I am using Umbraco Interaction Layer 1.1 and have generated various classes from my Document Types.


However, when I try to create an instance of my types, I get the following Exception:


DocTypeID provided did not match what was expected (provided: 1755, expected: 1755)


Wonder if someone could help. Is this a bug in the code, or am I doing something wrong?



Jul 30, 2009 at 1:41 PM

Ah, I found the problem:


Some of the Document Type aliases (wrongly) had spaces in them, and the generated code was removing the space [UmbracoDocTypeInfo(Alias="MyAlias", Id=1755)].


So the comparison this.DocTypeInfo.Alias != source.ContentType.Alias in DocTypeBase.cs was comparing 'My Alias' with 'MyAlias', returning false and throwing DocTypeMissMatchException


I've removed the spaces in the aliases and problem solved :)