我正在尝试获取 MvcMailer使用最新版本的 NuGet 在一个新的 MVC 4 Beta 项目中工作(创建只是为了尝试这个)。
我到了步骤
PM> Scaffold Mailer UserMailer Welcome,PasswordReset
此时我看到错误消息:
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
更新 :安装 MvcScaffolding(不是 NuGet 先决条件...)后,相同命令的错误消息更改为:
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
我该如何解决这个问题?
最佳答案
我遇到了同样的问题,为了解决这个问题,我更新了 Scaffolding 包(一次是 T4,另一次是 T4 + MVCScaffolding),然后重新启动 VS。
update-package T4Scaffolding
和/或
Update-Package MvcScaffolding
记得之后重启VS。
关于mvcmailer - MVC 4 中使用 MvcMailer 的错误脚手架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10241797/