Application can't scaffold items

In my case I moved my connection strings out of the Web.config to

<connectionStrings configSource="ConnectionStrings.config"/>

that when I started getting the error when I was trying to scaffold.

There was an error running the selected code generator: ‘Exception has been thrown by the target of an invocation.’

Moving my connection strings back to the Web.config solved my issue.


I had this problem too, I solved the problem by calling the base.onModelCreating in my DB context

base.OnModelCreating(modelBuilder);

This solved the issue for me,

Adding throwIfV1Schema: false to base of DbContext

As so:

public MyDbContext() : base("ConectionStringName", throwIfV1Schema: false) { }