Object type 'cms.class' not found.

Bradley Boltwood asked on January 28, 2019 17:01

I have set up a testing project using Kentico locally and I am wanting to connect to the Kentico Api using some of my tests to create users and customer..... but everytime it runs it is producing the following error:

Message: System.InvalidOperationException : Object type 'cms.class' not found.

Stack Trace:

CMS.DataEngine.ObjectQueryBase2.get_Object()
   at CMS.DataEngine.ObjectQueryBase2.get_TypeInfo()
   at CMS.DataEngine.ObjectQueryBase2.GetData()
   at CMS.DataEngine.DataQueryBase1.get_Result()
   at CMS.DataEngine.DataClassInfoProvider.GetClassStructureInfoFromDB(String className)
   at CMS.DataEngine.ClassStructureInfo.GetClassInfo(String className)
   at CMS.DataEngine.ObjectTypeInfo.get_ClassStructureInfo()
   at CMS.DataEngine.AbstractInfoBase1.EnsureData(Boolean loadDefault, Boolean applyTypeCondition)
   at CMS.DataEngine.AbstractInfoBase1.get_DataClass()
   at CMS.DataEngine.AbstractInfoBase1.ItemChanged(String columnName)
   at CMS.DataEngine.AbstractInfoBase1.TryGetValue(String columnName, Object& value)
   at CMS.DataEngine.AbstractInfoBase1.GetValue(String columnName)
   at CMS.DataEngine.DataClassInfoBase1.get_ClassShowAsSystemTable()
   at CMS.DataEngine.DataClassInfo.get_TypeInfo()
   at CMS.DataEngine.BaseInfo.CheckLicense(ObjectActionEnum action, String domainName)
   at CMS.DataEngine.BaseInfo.GeneralizedInfoWrapper.CheckLicense(ObjectActionEnum action, String domainName)
   at CMS.DataEngine.AbstractInfoProvider3.GetObjectQuery(Boolean checkLicense)
   at CMS.DataEngine.DataClassInfoProviderBase1.GetClasses()
   at CMS.DataEngine.DataClassInfoProvider.GetClassStructureInfoFromDB(String className)
   at CMS.DataEngine.ClassStructureInfo.GetClassInfo(String className)
   at CMS.DataEngine.ObjectTypeInfo.get_ClassStructureInfo()
   at CMS.DataEngine.AbstractInfoBase1.EnsureData(Boolean loadDefault, Boolean applyTypeCondition)
   at CMS.DataEngine.AbstractInfoBase1.get_DataClass()
   at CMS.DataEngine.AbstractInfoBase1.TryGetValue(String columnName, Object& value)
   at CMS.Membership.UserInfo.TryGetValue(String columnName, Object& value)
   at CMS.DataEngine.AbstractInfoBase1.GetValue(String columnName)
   at CMS.Membership.UserInfo.get_SiteIndependentPrivilegeLevel()
   at CMS.Membership.UserInfo.GetPrivilegeLevelForSite(String siteName)
   at CMS.Membership.UserInfo.CheckLicense(ObjectActionEnum action, String domainName)
   at CMS.DataEngine.BaseInfo.GeneralizedInfoWrapper.CheckLicense(ObjectActionEnum action, String domainName)
   at CMS.DataEngine.AbstractInfoProvider3.GetObjectQuery(Boolean checkLicense)
   at CMS.Membership.UserInfoProvider.GetUsers()  

Recent Answers


Peter Mogilnitski answered on January 28, 2019 17:55

Did you do the init? CMS.DataEngine.CMSApplication.Init()

1 votesVote for this answer Mark as a Correct answer

Bradley Boltwood answered on January 28, 2019 18:00

Hi Peter,

Yes, I have that in already

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on January 29, 2019 05:03

Is this code running in the Kentico project or are you using Kenticos packages to access a Kentico instance? Seems like either some libraries are missing or the Kentico nugget packages didn't install fully or you're missing some.

0 votesVote for this answer Mark as a Correct answer

Bradley Boltwood answered on January 29, 2019 14:33

No, I have set it up in its own test project?

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on January 29, 2019 19:24

Okay, can you list off what Kentico nuget packages you have installed on your test application?

You should have all the ones listed here:

https://docs.kentico.com/k12/developing-websites/starting-with-mvc-development/installing-kentico-integration-packages

Assuming Kentico 12, if another version you may need to look to another page.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.