Mitchell CSharp
Mitchell CSharp

Reputation: 131

C# EF Core Razor pages Entity Framework CRUD: There was an error running the selected code generator: Could not get the reflection type for DbContext

I am doing Razor Pages using EF Core. And I did several times scaffolding and it was OK, but after several commits I started gettign this error:

There was an error running the selected code generator: Could not get the reflection type for DbContext

enter image description here

WHY? What happened with scaffolding?

Upvotes: 0

Views: 519

Answers (1)

Mitchell CSharp
Mitchell CSharp

Reputation: 131

It was unsafe { } block in the C# code.


After commenting unsafe code, EF scaffolding can be run successfully.

Upvotes: 0

Related Questions