I have a VS2013 telerik mvc project and I have added a Class Library Project which has my DB models. I have already add the reference to my telerik mvc project but when I select the Kendo UI Scaffolding and select one of muy models inside de Class Library Project it always says:
'There was an error running the selected code generator 'Invalid Model Configuration'
but I don't know what I'm missing. I'm using entity framework 5.0.0 with as the model generator.
If someone has any idea I'll appreciate it.
23 Answers, 1 is accepted
Hello,
Currently the Kendo UI Scaffolder only supports entities from the current project, in which the scaffolding is performed. We will consider improving this functionality in future releases.
Regards,Dimiter Madjarov
Telerik
You guys really need to add more info to the error message. I'm generating against a model class that is in the Web project. Yet I'm getting the error. It's very frustrating. It must say what exactly is invalid in the model configuration.
Hello Shawn,
Thank you for the feedback. We will take into consideration and provide additional information to the user when initiating a scaffolding in future releases.
Regards,Dimiter Madjarov
Telerik
I have found a solution - Add Project Reference.
Example :
ClassLibrary : ClassLibrary1
Web Application : WebApp1
*ClassLibrary1 and WebApp1 must exists in the same soluton.
WebApp1 - Add Reference, In Reference Manager expand Projects then select/check ClassLibrary1, OK.
After project reference added, the DbContext/Model could be listed by any Scaffolder :
。MVC 5 Controller with read/write actions
。MVC 5 Controller with view, usint Entity Framework
。Kendo UI Scaffolder
。And more
Notice :
。The old reference of ClassLibrary should be removed first.
。The EntitySetName must defined in the DbContext :
public class DbContext1 : DbContext
{
public DbSet<Model1> Models { get; set; }
public DbContext1() : base("name=Connection1")
{
Else exception will occur :
"object reference not set to an instance of an object"
。If DbContext(name) was used then the name must be defined in WebApp1's Web.config
<connectionStrings>
<add name="Connection1" ...
Else exception will occur :
"Unable to retrieve metadata for '...'. No connection string named '...' could be found in the application config file."
Best regards
Chris
Hello Chris,
This is correct. Thank you for sharing the information with the community.
Have a great day!
Dimiter Madjarov
Telerik
I'm receiving this same error. I have an MVC app with everything contained within the app, ie models, views etc. When try and add a new scaffolded view, I get the error 'There was an error running the selected code generator: 'Invalid model configuration'.
Again, the model is contained within the project and IS currently in the Context that I selected in the wizard.
Hello Mike,
I covered the question in the support thread on the same topic. Let me know if you have further inquiries regarding the case there.
Regards,Dimiter Madjarov
Telerik
HI Mike
I have met the error 'Invalid model configuration' before.
It's mean that the model class you defined not met the some conditions for scaffolder,
In this error, you should add the [Key] attribute to the model you defined then retry :
public class Model1
{
[Key]
public string ProductID { get; set; }
...
Best regards
Chris
Hello Vassili King,
Are you experiencing an issue with the Kendo UI Scaffolder? If that is the case, could you provide further details about it?
Regards,Dimiter Madjarov
Telerik
Hello everyone,
I'm getting the same message on ASP.NET 5 (MVC 6, EF7) project. I never had this message before. Is this because of Telerik not supporting MVC 6, or there is another reason for that?
Please advice,
Alex
Hello Alexandros,
Yes, currently the Kendo UI Scaffolder does not support MVC 6 environment.
Regards,Dimiter Madjarov
Telerik
Hello Dimiter,
Thanks for your reply. May I know if this feature is going to be available during RC or RTM?
Best,
Alex
We do not have it planned for the MVC 6 official release, but as soon as more information is available, we will make sure to get it posted.
Regards,
Kiril Nikolov
Telerik
Hello,
Currently I have latest version of Kendo UI Scaffolder v.2016.1.226, in which the scaffolding throwing this exception. Can you help, what should I do?
Hello Olesya,
Please make sure that the selected model is a valid entity from the current Data Context. If that is the case and the issue is still reproducing you could send us an isolated project (here or in a support ticket) in which the issue is reproducing, so we could take a look locally.
Regards,Dimiter Madjarov
Telerik
Good morning.
Our entites are in the Swis.Core project, and we are perfoming scaffolding in another project WebUI. EF DbContext is in project Swis.Data. Does it functionality works in latest version? If not how can we scaffold our entities for admin module?
Hello Olesya,
The scenario is currently not supported by the Kendo UI Scaffolder. We have it considered for improvement in future releases.
Regards,Dimiter Madjarov
Telerik
In a real-world scenario, this Scaffolding thing is useless. We try to coach programmers SOC properly and when they use tools like these, they get it all wrong and are directed to tightly couple the solutions they are putting in place.
You really need to step that one up, I think.
Thanks.
We remain open for any suggestion, bug reports and general feedback. So please send us an email with the problems that you faced and we will be happy to take a look.
Regards,
Kiril Nikolov
Telerik
Hello,
I`m new in web development and telerik. I try to build the team efficiency app from your tutorial as a starting point:
http://docs.telerik.com/aspnet-mvc/tutorials/quickstart/team-efficiency
Getting
the "Invalid Model Configuration" when using the scaffolder wizard. The
solution from your documentary is to use a "valid model", but this
doesn`t help me cause i don`t know what i have to do exactly... I have
followed all the steps in your tutorial, don`t understand if i missed
something or did something wrong...
Fresh VS2015 install. All ASP.net extensions installed with update manager. Telerik plugins updated 15 min ago.
Thx in advance
Thanks for reaching out.
Please open a separate support request with more information about your model and setup and we will be happy to investigate.
Thanks!
Regards,
Kiril Nikolov
Telerik by Progress