我正在尝试添加一个指定了以下模板的新控制器:
MvcScaffolding:具有读/写操作和视图的控制器,使用存储库
这在以前的项目中是有效的,但我现在从包管理器中获得了以下输出:
Scaffolding SubjectsController...
LibraryContext already has a member called 'Subjects'. Skipping...
Add-ProjectItemViaTemplate : The term 'Find-ScaffolderTemplate' resolved to a cmdlet name that is ambiguous. Possible m
atches include: T4Scaffolding\Find-ScaffolderTemplate T4Scaffolding\Find-ScaffolderTemplate.
At C:\Development\packages\T4Scaffolding.1.0.0\tools\EFRepository\T4Scaffolding.EFRepository.ps1:47 char:27
+ Add-ProjectItemViaTemplate <<<< $outputPath -Template Repository -Model @{
+ CategoryInfo : NotSpecified: (:) [Add-ProjectItemViaTemplate], CommandNotFoundException
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.AddProjectItemViaTemplateCmdlet
Add-ProjectItemViaTemplate : The term 'Find-ScaffolderTemplate' resolved to a cmdlet name that is ambiguous. Possible m
atches include: T4Scaffolding\Find-ScaffolderTemplate T4Scaffolding\Find-ScaffolderTemplate.
At C:\Development\packages\MvcScaffolding.1.0.0\tools\Controller\MvcScaffolding.Controller.ps1:106 char:27
+ Add-ProjectItemViaTemplate <<<< $outputPath -Template $templateName -Model @{
+ CategoryInfo : NotSpecified: (:) [Add-ProjectItemViaTemplate], CommandNotFoundException
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.AddProjectItemViaTemplateCmdlet
Add-ProjectItemViaTemplate : The term 'Find-ScaffolderTemplate' resolved to a cmdlet name that is ambiguous. Possible m
atches include: T4Scaffolding\Find-ScaffolderTemplate T4Scaffolding\Find-ScaffolderTemplate.
At C:\Development\packages\MvcScaffolding.1.0.0\tools\RazorView\MvcScaffolding.RazorView.ps1:49 char:27
+ Add-ProjectItemViaTemplate <<<< $outputPath -Template $Template -Model @{
+ CategoryInfo : NotSpecified: (:) [Add-ProjectItemViaTemplate], CommandNotFoundException
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.AddProjectItemViaTemplateCmdlet
Add-ProjectItemViaTemplate : The term 'Find-ScaffolderTemplate' resolved to a cmdlet name that is ambiguous. Possible m
atches include: T4Scaffolding\Find-ScaffolderTemplate T4Scaffolding\Find-ScaffolderTemplate.
At C:\Development\packages\MvcScaffolding.1.0.0\tools\RazorView\MvcScaffolding.RazorView.ps1:49 char:27
+ Add-ProjectItemViaTemplate <<<< $outputPath -Template $Template -Model @{
+ CategoryInfo : NotSpecified: (:) [Add-ProjectItemViaTemplate], CommandNotFoundException
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.AddProjectItemViaTemplateCmdlet
Add-ProjectItemViaTemplate : The term 'Find-ScaffolderTemplate' resolved to a cmdlet name that is ambiguous. Possible m
atches include: T4Scaffolding\Find-ScaffolderTemplate T4Scaffolding\Find-ScaffolderTemplate.
At C:\Development\packages\MvcScaffolding.1.0.0\tools\RazorView\MvcScaffolding.RazorView.ps1:49 char:27
+ Add-ProjectItemViaTemplate <<<< $outputPath -Template $Template -Model @{
+ CategoryInfo : NotSpecified: (:) [Add-ProjectItemViaTemplate], CommandNotFoundException
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.AddProjectItemViaTemplateCmdlet
Add-ProjectItemViaTemplate : The term 'Find-ScaffolderTemplate' resolved to a cmdlet name that is ambiguous. Possible m
atches include: T4Scaffolding\Find-ScaffolderTemplate T4Scaffolding\Find-ScaffolderTemplate.
At C:\Development\packages\MvcScaffolding.1.0.0\tools\RazorView\MvcScaffolding.RazorView.ps1:49 char:27
+ Add-ProjectItemViaTemplate <<<< $outputPath -Template $Template -Model @{
+ CategoryInfo : NotSpecified: (:) [Add-ProjectItemViaTemplate], CommandNotFoundException
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.AddProjectItemViaTemplateCmdlet
Add-ProjectItemViaTemplate : The term 'Find-ScaffolderTemplate' resolved to a cmdlet name that is ambiguous. Possible m
atches include: T4Scaffolding\Find-ScaffolderTemplate T4Scaffolding\Find-ScaffolderTemplate.
At C:\Development\packages\MvcScaffolding.1.0.0\tools\RazorView\MvcScaffolding.RazorView.ps1:49 char:27
+ Add-ProjectItemViaTemplate <<<< $outputPath -Template $Template -Model @{
+ CategoryInfo : NotSpecified: (:) [Add-ProjectItemViaTemplate], CommandNotFoundException
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.AddProjectItemViaTemplateCmdlet
Add-ProjectItemViaTemplate : The term 'Find-ScaffolderTemplate' resolved to a cmdlet name that is ambiguous. Possible m
atches include: T4Scaffolding\Find-ScaffolderTemplate T4Scaffolding\Find-ScaffolderTemplate.
At C:\Development\packages\MvcScaffolding.1.0.0\tools\RazorView\MvcScaffolding.RazorView.ps1:49 char:27
+ Add-ProjectItemViaTemplate <<<< $outputPath -Template $Template -Model @{
+ CategoryInfo : NotSpecified: (:) [Add-ProjectItemViaTemplate], CommandNotFoundException
+ FullyQualifiedErrorId : T4Scaffolding.Cmdlets.AddProjectItemViaTemplateCmdlet知道发生了什么事吗?
发布于 2011-10-28 16:56:24
当您安装T4Scaffolding包时,它会在powershell主机中注册它的程序集和包含的cmdlet。由于某些原因,它可能会从两个不同的位置加载T4Scaffolding包,并且您会得到“解析为不明确的cmdlet名称”错误,因为powershell无法决定执行哪个包cmdlet。正如我所看到的,你从"C:\Development\packages\MvcScaffolding.1.0.0\tools\RazorView\MvcScaffolding.RazorView.ps1“执行模板,它看起来像一个全局包,如果你在你的解决方案中本地安装了MvcsScaffolding - (SolutionFolder)\packages\MvcScaffolding.1.0.0 powershell可能会加载这两个包。
如果您从Visual Studio项目->右键->生成控制器生成控制器,它将作为Visual Studio插件来生成控制器,而不使用T4Scaffolding ->命令。
https://stackoverflow.com/questions/6013030
复制相似问题