Scaffolding: Scaffolding fails if model class is in a dependency (project/ library) of the project on which scaffolding is being run.

Project A has a dependeny on Project B. Project B has model class If you try to run scaffolding on Project A by using model class from Project B, it fails with the below error: No model type returned for type: <class name>

image

Related #249 #140

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 2
  • Comments: 35 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Still, exists.

Thanks @Vikaskumargd, The problem is with the DbContext being in the library, not the model classes. The DbContext in libraries isn’t supported fully because editing it is not possible, however, it is possible to make it work if no edits are needed. I have filed https://github.com/aspnet/Scaffolding/issues/365 to enable this scenario. As a workaround for now, you can try to move the DbContext to the main project.

i am using v1.1.0 and this issue is still there

Still exists

Thanks a lot @prafullbhosale it works like a charm πŸ‘ πŸ‘ . So what I get is that the main project is not have enough permissions to edit the files of other class libraries or something like that. Is this correct?

@RupeshY, this issue is fixed in the Dev branch.