question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scaffolding fails to get type information about the Model class from DbContext if the DbContext class is in a dependency

See original GitHub issue

Related: https://github.com/aspnet/Scaffolding/issues/407#issuecomment-284031010

This is because the Roslyn returns ErrorType for types defined in transitive references.

cc @Eilon @mlorbetske

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
oswaldoporcaricommented, Jul 18, 2020

I have the same problem in version 3.1

0reactions
XF-at-Checkmarxcommented, Jun 23, 2021

Same here. Reproducible in 3.14.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scaffolding fails if model class is in a dependency (project ...
Scaffolding fails if model class is in a dependency (project/ library) of the project on which scaffolding is being run. #251.
Read more >
The term 'scaffold-dbcontext' is not recognized as the name ...
Another problem I encountered : with the dbcontext located in a separate class library, I was encountering the following error :.
Read more >
Scaffolding (Reverse Engineering) - EF Core
Reverse engineering is the process of scaffolding entity type classes and a DbContext class based on a database schema.
Read more >
Scaffolding Error when Model and DbContext are in ...
Scaffolding views with VS2017 v15.4.1 and entity framework core 2.0 fails when my model and data classes are in separate class libraries.
Read more >
Fix the 'Unable to resolve service for type Microsoft ...
This error means you haven't registered your DbContext as a service in the ConfigureServices section of Startup.cs. This post shows you how.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found