版本更新后的MethodArgumentConversionInvalidCastArgument

时间:2014-04-04 21:21:55

标签: nuget

将NuGet更新到版本2.8.50313.31后,打开程序包管理器控制台会显示许多错误。

这是(现在的)版本的已知问题吗?有修复/解决方法吗?

如果没有修复,如何恢复到以前版本的NuGet?

  

New-Object:无法加载文件或程序集   ' System.Management.Automation,Ver sion = 3.0.0.0,Culture = neutral,   公钥= 31bf3856ad364e35'或其中一个依赖性。该   系统找不到指定的文件。在   E:\ dev的\ myProject的\包\ MvcScaffolding.1.0.6 \工具\ registerWithMvcTooling.ps1   :143 char:27   + $ newProvider = New-Object<<<< $ powerShellScaffolderProviderType($ mvcSca ffoldingProvider)       + CategoryInfo:NotSpecified:(:) [New-Object],FileNotFoundExce ption       + FullyQualifiedErrorId:System.IO.FileNotFoundException,Microsoft.PowerS
  hell.Commands.NewObjectCommand无法转换参数" 0",with   值:" Microsoft.VisualStudio.Web.Mvc.Scaffo   lding.PowerShell.PowerShellScaffolderProvider",for" Add"输入   " Microsoft.Vi   sualStudio.Web.Mvc.Extensibility.Scaffolding.ScaffolderProvider&#34 ;:   "无法召开会议   " Microsoft.VisualStudio.Web.Mvc.Scaffolding.PowerShell.PowerShellScaffol   derProvider"类型的价值   " Microsoft.VisualStudio.Web.Mvc.Scaffolding.PowerShe   ll.PowerShellScaffolderProvider"输入   " Microsoft.VisualStudio.Web.Mvc.Extens   ibility.Scaffolding.ScaffolderProvider""在   E:\ dev的\ myProject的\包\ MvcScaffolding.1.0.6 \工具\ registerWithMvcTooling.ps1   :144 char:19   + $ allProviders.Add<<<< ($ newProvider)|外空       + CategoryInfo:NotSpecified:(:) [],MethodException       + FullyQualifiedErrorId:MethodArgumentConversionInvalidCastArgument PM>新对象:可以   不加载文件或程序集&System; Management.Management.Automation,Ver   sion = 3.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'或者一个   它的依赖性。该系统找不到指定的文件。在   E:\ dev的\ myProject的\包\ MvcScaffolding.1.0.6 \工具\ registerWithMvcTooling.ps1   :143 char:27   + $ newProvider = New-Object<<<< $ powerShellScaffolderProviderType($ mvcSca ffoldingProvider)       + CategoryInfo:NotSpecified:(:) [New-Object],FileNotFoundExce ption       + FullyQualifiedErrorId:System.IO.FileNotFoundException,Microsoft.PowerS
  hell.Commands.NewObjectCommand无法转换参数" 0",with   值:" Microsoft.VisualStudio.Web.Mvc.Scaffo   lding.PowerShell.PowerShellScaffolderProvider",for" Add"输入   " Microsoft.Vi   sualStudio.Web.Mvc.Extensibility.Scaffolding.ScaffolderProvider&#34 ;:   "无法召开会议   " Microsoft.VisualStudio.Web.Mvc.Scaffolding.PowerShell.PowerShellScaffol   derProvider"类型的价值   " Microsoft.VisualStudio.Web.Mvc.Scaffolding.PowerShe   ll.PowerShellScaffolderProvider"输入   " Microsoft.VisualStudio.Web.Mvc.Extens   ibility.Scaffolding.ScaffolderProvider""在   E:\ dev的\ myProject的\包\ MvcScaffolding.1.0.6 \工具\ registerWithMvcTooling.ps1   :144 char:19   + $ allProviders.Add<<<< ($ newProvider)|外空       + CategoryInfo:NotSpecified:(:) [],MethodException       + FullyQualifiedErrorId:MethodArgumentConversionInvalidCastArgument New-Object:无法   加载文件或程序集&System; Management.Management.Automation,Ver sion = 3.0.0.0,   Culture = neutral,PublicKeyToken = 31bf3856ad364e35'或其中一个d   ependencies。该系统找不到指定的文件。在   E:\ dev的\ myProject的\包\ MvcScaffolding.1.0.6 \工具\ registerWithMvcTooling.ps1   :143 char:27   + $ newProvider = New-Object<<<< $ powerShellScaffolderProviderType($ mvcSca ffoldingProvider)       + CategoryInfo:NotSpecified:(:) [New-Object],FileNotFoundExce ption       + FullyQualifiedErrorId:System.IO.FileNotFoundException,Microsoft.PowerS
  hell.Commands.NewObjectCommand无法转换参数" 0",with   值:" Microsoft.VisualStudio.Web.Mvc.Scaffo   lding.PowerShell.PowerShellScaffolderProvider",for" Add"输入   " Microsoft.Vi   sualStudio.Web.Mvc.Extensibility.Scaffolding.ScaffolderProvider&#34 ;:   "无法召开会议   " Microsoft.VisualStudio.Web.Mvc.Scaffolding.PowerShell.PowerShellScaffol   derProvider"类型的价值   " Microsoft.VisualStudio.Web.Mvc.Scaffolding.PowerShe   ll.PowerShellScaffolderProvider"输入   " Microsoft.VisualStudio.Web.Mvc.Extens   ibility.Scaffolding.ScaffolderProvider""在   E:\ dev的\ myProject的\包\ MvcScaffolding.1.0.6 \工具\ registerWithMvcTooling.ps1   :144 char:19   + $ allProviders.Add<<<< ($ newProvider)|外空       + CategoryInfo:NotSpecified:(:) [],MethodException       + FullyQualifiedErrorId:MethodArgumentConversionInvalidCastArgument

1 个答案:

答案 0 :(得分:0)

事实证明,解决方案中的任何项目都不再引用MvcScaffolding.1.0.6

从NuGet命令行中删除它

Uninstall-Package MvcScaffolding

解决了这个问题。

MvcScaffolding目前有1.0.9版本。该版本可能会解决该问题。但是,由于我不再引用该包,我没有测试它。