Module Classs.

Richard Coady asked on August 13, 2019 18:38

Hi,

I have created a module and a class with fields and associated UI. The UI works ok, I can add and delete records to the module table.

But when I try to access through code I get the following error ar sproConfig = SensorPro.ConfigurationInfoProvider.GetConfigurations();

{"Object type 'sensorpro.configuration' not found."}

Any ideas?

Thanks

Correct Answer

Trevor Fayas answered on August 15, 2019 18:07

I bet i know the issue.

Is your info.cs and infoprovider.cs classes in a separate project?

And if so, did you remember to put the [assembly: AssemblyDiscoverable] tag in the project's AssemblyInfo.cs?

If you haven't, then it probably won't detect your classes.

Allowing discovery of the generated classes in custom assemblies

0 votesVote for this answer Unmark Correct answer

Recent Answers


Trevor Fayas answered on August 13, 2019 21:19

Can you post your ConfigurationInfo class code somewhere? The issue is probably some misconfiguration in there.

0 votesVote for this answer Mark as a Correct answer

Richard Coady answered on August 14, 2019 11:39

Thanks, the generated code is here...

https://sensorpro.net/downloads/50ServiceReleases/ConfigurationInfo.txt https://sensorpro.net/downloads/50ServiceReleases/ConfigurationInfoProvider.txt

0 votesVote for this answer Mark as a Correct answer

Brian McKeiver answered on August 14, 2019 20:08

Richard, that could mean the Object Type sensorpro.configuration can't be found in the Kentico database (no matching class with that name). If you query CMS_Class Table for sensorpro.configuration in the database do you get a matching row?

SELECT * FROM [CMS_Class] WHERE ClassName = 'sensorpro.configuration'

Is it possible your module's custom class has a slightly different code name ?

0 votesVote for this answer Mark as a Correct answer

Richard Coady answered on August 15, 2019 17:45

Thanks Brian, for the suggestion. The query returns a record alright

SELECT * FROM [CMS_Class] WHERE ClassName = 'sensorpro.configuration' 5513 Configuration SensorPro.Configuration

What is weird is that it does not seem to show anything in sql trace when i do a int x = SensorPro.ConfigurationInfoProvider.GetCount(); or var sproConfig = SensorPro.ConfigurationInfoProvider.GetConfigurations();

I just get the following, {"Object type 'sensorpro.configuration' not found."}

The subsequent lines call standard Kentico providers which work Ok, so I think everything is initialized ok.

Thanks Richard

0 votesVote for this answer Mark as a Correct answer

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