脚手架Get-ProjectType未被识别为cmdlet的名称

时间:2012-07-10 20:22:14

标签: asp.net-mvc-3 powershell asp.net-mvc-4 scaffolding asp.net-mvc-scaffolding

只是尝试了解基本的基础知识并运行并获得一些花哨的错误条件 - 最可能的一些基本步骤被搞砸但我没有看到重点 - 所以一些提示非常受欢迎。

那么设置是什么?

会发生什么?

尝试(通过NuGet控制台安装MvcScaffolding后)来调用:

Scaffold Controller Team

并收到以下错误:

PM> Scaffold Controller Team
Scaffolding TeamsController...
Invoke-Scaffolder : The term 'Get-ProjectType' 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 O:\Code\Resource\packages\MvcScaffolding.1.0.7\tools\Controller\MvcScaffolding.Controller.ps1:66 char:40
+         $dbContextScaffolderResult = Scaffold <<<<  DbContext -ModelType $foundModelType.FullName -DbContextType $DbContextType -Area $Area -Project $Project -CodeLang
uage $CodeLanguage -BlockUi
    + CategoryInfo          : NotSpecified: (:) [Invoke-Scaffolder], CommandNotFoundException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.InvokeScaffolderCmdlet

花哨的事情:当然Get-ProjectType本身似乎有效(见下文),所以我现在有点卡住了 - 因为这看起来像是一个PowerShell问题但是cmdlet本身至少在直接调用时工作但不是在脚本里面?任何提示都将不胜感激!

非常感谢。

PM> Get-ProjectType
cmdlet Get-ProjectType at command pipeline position 1
Supply values for the following parameters:
Type: Team


DTE                   : System.__ComObject
Collection            : System.__ComObject
Name                  : Team
FullName              : Resource.Models.Team
ProjectItem           : System.__ComObject
Kind                  : 1
IsCodeType            : True
InfoLocation          : 1
Children              : System.__ComObject
Language              : {B5E9BD34-6D3E-4B5D-925E-8A43B79820B4}
StartPoint            : System.__ComObject
EndPoint              : System.__ComObject
ExtenderNames         : 
ExtenderCATID         : 
Parent                : System.__ComObject
Namespace             : System.__ComObject
Bases                 : System.__ComObject
Members               : System.__ComObject
Access                : 1
Attributes            : System.__ComObject
DocComment            : <doc>
                        </doc>
Comment               : 
DerivedTypes          : 
ImplementedInterfaces : System.__ComObject
IsAbstract            : False
ClassKind             : 1
PartialClasses        : System.__ComObject
DataTypeKind          : 1
Parts                 : System.__ComObject
InheritanceKind       : 0
IsGeneric             : False
IsShared              : False



PM> 

有亲切的问候, 艾夫斯

0 个答案:

没有答案