Scaffold no longer works

Apr 15, 2011 at 11:33 PM
Edited Apr 16, 2011 at 12:18 AM

I worked through Steve's first blog post on Scaffolding project back in January-February, and everything was working fine. I couldn't wait to learn how to tweak T4 templates. Well, by now I installed MVC3 tools update, so I decide to quickly get through the posts to the point where I stopped. Unfortunately, I was disappointed.

I am getting an error (somebody reported the same error in Steve's Blog):


PM> Scaffold Controller Team
Invoke-Scaffolder : A positional parameter cannot be found that accepts argument 'Team'.
At line:1 char:9
+ Scaffold <<<<  Controller Team
    + CategoryInfo          : InvalidArgument: (:) [Invoke-Scaffolder], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,T4Scaffolding.Cmdlets.InvokeScaffolderCmdlet


Interesting, if I look at cmdlet's parameters, this error makes sense:



PM> Get-Help scaffold

    Invoke-Scaffolder [-Scaffolder] <String> [-Project <String>] [-OverrideTemplateFolders <Object[]>] 
[-BlockUi] [-PipeOutput] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>]
[-WarningAction <ActionPreference>] [-ErrorVariable <String>] [-WarningVariable <String>]
[-OutVariable <String>] [-OutBuffer <Int32>]


That is, there are no positional parameters except for the scaffolder itself (which is in our case "Controller").

So, now I am stuck...

Update: I tried the same on a different computer, and everything works. So, it's not just the updates in Scaffolding package and MVC3 tools. I also noticed that on the problematic system I get two versions of the package - 0.9.4 and 0.9.9. Not sure why. On the other computer I see only 0.9.9. Any advice would be appreciated

Apr 21, 2011 at 4:01 PM

We found numerous issues with several demos we were following and in our own work prior to the release of the new tools and were reluctant to upgrade in the middle of a project we had started prior to VS 2010 SP1. However, when the tools were announced we upgrded both Visual Studio and MVC so they were current as of 15 April and have found much of the odd behaviours dissappeared. Not sure if this applies to you but I will try to run through Steve's post on the weekend and see if we reproduce any such problem.

Apr 21, 2011 at 5:18 PM

I still don't know what causes that; but I figured a way to fix it :)

Nuget installed the packages into "project folder"\packages or "project folder"\"current project"\packages. I am not sure why it got installed in different places (maybe it changed with Nuget upgrade - who knows!)... but I deleted everything from top-level folder, installed packages again, and everything is working now

Nov 4, 2011 at 4:32 PM

Virshu. Thank you very much for posting the solution. It worked for me.