0
votes

After updating NuGet to version 2.8.50313.31, opening the Package Manager Console displays a number of errors.

Is this a known issue with that (now current) version? Is there a fix/work-around?

If there is no fix, how does one revert to the previous version of NuGet?

New-Object : Could not load file or assembly 'System.Management.Automation, Ver sion=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its d ependencies. The system cannot find the file specified. At E:\dev\myProject\packages\MvcScaffolding.1.0.6\tools\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 Cannot convert argument "0", with value: "Microsoft.VisualStudio.Web.Mvc.Scaffo lding.PowerShell.PowerShellScaffolderProvider", for "Add" to type "Microsoft.Vi sualStudio.Web.Mvc.Extensibility.Scaffolding.ScaffolderProvider": "Cannot conve rt the "Microsoft.VisualStudio.Web.Mvc.Scaffolding.PowerShell.PowerShellScaffol derProvider" value of type "Microsoft.VisualStudio.Web.Mvc.Scaffolding.PowerShe ll.PowerShellScaffolderProvider" to type "Microsoft.VisualStudio.Web.Mvc.Extens ibility.Scaffolding.ScaffolderProvider"." At E:\dev\myProject\packages\MvcScaffolding.1.0.6\tools\registerWithMvcTooling.ps1 :144 char:19 + $allProviders.Add <<<< ($newProvider) | Out-Null + CategoryInfo : NotSpecified: (:) [], MethodException + FullyQualifiedErrorId : MethodArgumentConversionInvalidCastArgument PM> New-Object : Could not load file or assembly 'System.Management.Automation, Ver sion=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its d ependencies. The system cannot find the file specified. At E:\dev\myProject\packages\MvcScaffolding.1.0.6\tools\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 Cannot convert argument "0", with value: "Microsoft.VisualStudio.Web.Mvc.Scaffo lding.PowerShell.PowerShellScaffolderProvider", for "Add" to type "Microsoft.Vi sualStudio.Web.Mvc.Extensibility.Scaffolding.ScaffolderProvider": "Cannot conve rt the "Microsoft.VisualStudio.Web.Mvc.Scaffolding.PowerShell.PowerShellScaffol derProvider" value of type "Microsoft.VisualStudio.Web.Mvc.Scaffolding.PowerShe ll.PowerShellScaffolderProvider" to type "Microsoft.VisualStudio.Web.Mvc.Extens ibility.Scaffolding.ScaffolderProvider"." At E:\dev\myProject\packages\MvcScaffolding.1.0.6\tools\registerWithMvcTooling.ps1 :144 char:19 + $allProviders.Add <<<< ($newProvider) | Out-Null + CategoryInfo : NotSpecified: (:) [], MethodException + FullyQualifiedErrorId : MethodArgumentConversionInvalidCastArgument New-Object : Could not load file or assembly 'System.Management.Automation, Ver sion=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its d ependencies. The system cannot find the file specified. At E:\dev\myProject\packages\MvcScaffolding.1.0.6\tools\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 Cannot convert argument "0", with value: "Microsoft.VisualStudio.Web.Mvc.Scaffo lding.PowerShell.PowerShellScaffolderProvider", for "Add" to type "Microsoft.Vi sualStudio.Web.Mvc.Extensibility.Scaffolding.ScaffolderProvider": "Cannot conve rt the "Microsoft.VisualStudio.Web.Mvc.Scaffolding.PowerShell.PowerShellScaffol derProvider" value of type "Microsoft.VisualStudio.Web.Mvc.Scaffolding.PowerShe ll.PowerShellScaffolderProvider" to type "Microsoft.VisualStudio.Web.Mvc.Extens ibility.Scaffolding.ScaffolderProvider"." At E:\dev\myProject\packages\MvcScaffolding.1.0.6\tools\registerWithMvcTooling.ps1 :144 char:19 + $allProviders.Add <<<< ($newProvider) | Out-Null + CategoryInfo : NotSpecified: (:) [], MethodException + FullyQualifiedErrorId : MethodArgumentConversionInvalidCastArgument

1

1 Answers

0
votes

It turns out that MvcScaffolding.1.0.6 is no longer referenced by any project in the solution.

Removing it from the NuGet command line

Uninstall-Package MvcScaffolding

resolved the issue.

There is currently version 1.0.9 of MvcScaffolding. The issue may be resolved in that version. However, since I no longer reference that package, I did not test that.