Question

I've been developing an ASP.NET MVC 4 project for a while now and I've been using the "MVCScaffolding" package successfully but a few days ago I noticed that when creating a new controller for example the item for MVCScaffolding does not show up anymore. trying to run the scaffold command will also result in the following error:

The term 'scaffold' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:9
+ scaffold <<<< 
    + CategoryInfo          : ObjectNotFound: (scaffold:String) [], CommandNotFoundException

I've noticed that this problem has been mentioned several times on this page but no solutions have been provided.

Also the "MVCScaffolding" package could be used by other projects under the same environment in different solutions but not the same solution so I guess it is something specific to this solution. I've already tried uninstalling and reinstalling the packages manually or by the following commands, reinstalling nuget and restarting VS an windows several times :) ;

Uninstall-Package MvcScaffolding -RemoveDependencies
Install-Package MvcScaffolding

What I'm looking for is first and obviously how to resolve this specific issue and second, In general in such cases where should one be looking for in order to start debugging the problem? how does the command prompt determines whether or not a command is available?

Thanks in advance.

Was it helpful?

Solution

MVC Scaffolding defines the 'scaffold' command alias when a solution is opened in Visual Studio. The T4Scaffolding.Core NuGet package is the one that actually calls Set-Alias to do this in its init.ps1. You could check that the init.ps1 for the T4Scaffolding NuGet package is being run.

OTHER TIPS

I know this post is really old.. but for those of you who are still facing this problem with VS2013, Please try the following:

  1. Uninstall-Package T4Scaffolding <-- If you have already used PM Console To Install it..

  2. Install by right clicking "references" -> Manage Nuget Packages -> Search for T4Scaffolding and install it from there..

By doing the above steps it worked like a charm for me

My Problem was solved by adding T4Scaffolding.Core through the NuGetPackage Manager. (version 1.0.8)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top