Visual Studio 2013 Scaffolding Error

If you have recently installed a package with T4Scaffolding dependency (ex. MVCMailer uses T4Scaffolding.Core), then you can uninstall T4Scaffolding.Core and restart VS 2013. Notice that MvcMailer which caused this in my case, won’t work in 2013. Best is to check your references or packages for suspects. From comments: Uninstalling it didn’t seem to work for … Read more

ASP.NET MVCScaffolding is very slow

I know it is an old question but maybe this helps someone else. It creates exclusions for Windows Defender for all folders and processes of Visual Studio $userPath = $env:USERPROFILE $pathExclusions = New-Object System.Collections.ArrayList $processExclusions = New-Object System.Collections.ArrayList $pathExclusions.Add(‘C:\Windows\Microsoft.NET’) > $null $pathExclusions.Add(‘C:\Windows\assembly’) > $null $pathExclusions.Add($userPath + ‘\.dotnet’) > $null $pathExclusions.Add($userPath + ‘\.librarymanager’) > $null $pathExclusions.Add($userPath … Read more

“There was an error running the selected code generator” in VS 2013 scaffolding

VS2013 Error: There was an error running the selected code generator: ‘ A configuration for type ‘SolutionName.Model.SalesOrder’ has already been added …’ I had this problem while working through a Pluralsight Course “Parent-Child Data with EF, MVC, Knockout, Ajax, and Validation”. I was trying to add a New Scaffolded Item using the template MVC 5 … Read more

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 … Read more

Scaffolding controller doesn’t work with visual studio 2013 update 2

Hey for all of you that nothing works, the real answer is you need to remove ANYTHING that has a configSource on the web.config and the connection string needs to be inlined. EDIT: Someone pointed out that it needs to be only <configSettings>, <appSettings>, and <connectionStrings> tags NOT using a configSource attribute. And that he … Read more

Can we Scaffold DbContext from selected tables of an existing database [duplicate]

One can solve the problem by usage of dotnet ef dbcontext scaffold command with multiple -t (–table) parameters. It allows to specify all the tables, which needed by imported (scaffolded). The feature is described initially here. It is possible to specify the exact tables in a schema to use when scaffolding database and to omit … Read more