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()
Did you do the init? CMS.DataEngine.CMSApplication.Init()
CMS.DataEngine.CMSApplication.Init()
Hi Peter,
Yes, I have that in already
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.
No, I have set it up in its own test project?
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.
Please, sign in to be able to submit a new answer.