Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Scaffolding with MvcMailer in MVC 4

Tags:

mvcmailer

I'm trying to get MvcMailer working in a new MVC 4 Beta project (created just for trying this out), using the latest version of NuGet.

I get to the step

PM> Scaffold Mailer UserMailer Welcome,PasswordReset

At which point I see the error message:

Cannot resolve alias 'Scaffold' because it refers to term 'Invoke-Scaffolder', which is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again. At line:1 char:9 + Scaffold <<<< Mailer UserMailer Welcome,PasswordReset + CategoryInfo : ObjectNotFound: (Scaffold:String) [], CommandNotFoundException + FullyQualifiedErrorId : AliasNotResolvedException

Update: After installing MvcScaffolding (wasn't a NuGet prerequisite...), the error message for the same command changes to:

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

How can I resolve this issue?

like image 333
Eric J. Avatar asked Apr 20 '12 07:04

Eric J.


1 Answers

I had the same issue, to fix it I updated the Scaffolding packages (T4 in one occasion, T4 + MVCScaffolding on another), and restarted VS.

update-package T4Scaffolding

and / or

Update-Package MvcScaffolding

remember to restart VS afterward.

like image 169
Segev -CJ- Shmueli Avatar answered Nov 03 '22 00:11

Segev -CJ- Shmueli