I looked on SO and google for a solution to this scaffolding struggle I'm having. No luck, so here's the Q:
I've used the (pretty great) articles Steve Anderson wrote about scaffolding to get the scaffolding for my project setup, but can't get one thing to work. http://blog.stevensanderson.com/2011/01/13/mvcscaffolding-standard-usage/
First I copied the CodeTemplates directory from VS 2013 into my project, like so: (I added arrows to the scaffolder I wish to use)
Then, when I scaffold from Visual Studio, I do Add -> Controller and select this scaffolding template:
And it all works, the scaffolder uses the custom CodeTemplate I copied into my project. Good times. But now the thing I can't get to work. I'd like to use the powershell (package manager console) of VS to do the scaffolding, because I have to re-scaffold all the controllers (about 15) with all the views often.
So I tried this:
Scaffold Controller -ControllerName MyController -DbContextType MyContext -Area MyArea -Force
But it uses the default controller set and not the one I edited in the CodeTemplates. Which scaffolders do I have anyway?
Hmm, ok, so now I try to set the default scaffolder to my own Controller scaffolder in the CodeTemplates directory:
And woosh, them's the breakes. So that's where I am stuck. I can't get the 'Scaffold' command in the console to work with my custom scaffolder in CodeTemplates.
Does anyone have an idea? Thx in advance.