Scaffolding commands stopped working, NuGet related?

Jan 6, 2012 at 6:13 PM

I returned to my project today and attempted to scaffold one of my models but I was constantly met with error messages no matter what I tried. The commands worked perfectly well just a couple months ago, so I suspected that the packages and NuGet were somehow incompatible. I'm running the very latest NuGet 1.6.21215.9133, by the way.

When I upgraded the packages, there seemed to be some trouble with the NuGet.SemanticVersion vs. the System.Version. The full list of messages are included below.

While I can't be sure what's causing this issue, I can say confidently that none of the scaffolding works with either the new packages or the old on my setup. Has anyone else encountered anything like this?

PM> Update-Package MvcScaffolding
Updating 'MvcScaffolding' from version '1.0.2' to '1.0.6' in project 'NameOfMyProject'.
Successfully removed 'MvcScaffolding 1.0.2' from NameOfMyProject.
Successfully removed 'T4Scaffolding 1.0.3' from NameOfMyProject.
Successfully installed 'T4Scaffolding 1.0.5'.
Set-DefaultScaffolder : Unable to cast object of type 'NuGet.SemanticVersion' to type
 'System.Version'.
At C:\Path\To\My\Project\packages\T4Scaffolding.1.0.5\tools\init.ps1:50 ch
ar:24
+         Set-DefaultScaffolder <<<<  -Name DbContext -Scaffolder T4Scaffolding.EFDbC
ontext -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidCast 
   Exception
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
 
Set-DefaultScaffolder : Unable to cast object of type 'NuGet.SemanticVersion' to type
 'System.Version'.
At C:\Path\To\My\Project\packages\T4Scaffolding.1.0.5\tools\init.ps1:51 ch
ar:24
+         Set-DefaultScaffolder <<<<  -Name Repository -Scaffolder T4Scaffolding.EFRe
pository -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidCast 
   Exception
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
 
Set-DefaultScaffolder : Unable to cast object of type 'NuGet.SemanticVersion' to type
 'System.Version'.
At C:\Path\To\My\Project\packages\T4Scaffolding.1.0.5\tools\init.ps1:52 ch
ar:24
+         Set-DefaultScaffolder <<<<  -Name CustomTemplate -Scaffolder T4Scaffolding.
CustomTemplate -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidCast 
   Exception
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
 
Set-DefaultScaffolder : Unable to cast object of type 'NuGet.SemanticVersion' to type
 'System.Version'.
At C:\Path\To\My\Project\packages\T4Scaffolding.1.0.5\tools\init.ps1:53 ch
ar:24
+         Set-DefaultScaffolder <<<<  -Name CustomScaffolder -Scaffolder T4Scaffoldin
g.CustomScaffolder -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidCast 
   Exception
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
 
Successfully added 'T4Scaffolding 1.0.5' to NameOfMyProject.
Successfully installed 'MvcScaffolding 1.0.6'.
Set-DefaultScaffolder : Unable to cast object of type 'NuGet.SemanticVersion' to type
 'System.Version'.
At C:\Path\To\My\Project\packages\MvcScaffolding.1.0.6\tools\init.ps1:35 c
har:22
+ Set-DefaultScaffolder <<<<  -Name Controller -Scaffolder MvcScaffolding.Controller 
-SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidCast 
   Exception
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
 
Set-DefaultScaffolder : Unable to cast object of type 'NuGet.SemanticVersion' to type
 'System.Version'.
At C:\Path\To\My\Project\packages\MvcScaffolding.1.0.6\tools\init.ps1:36 c
har:22
+ Set-DefaultScaffolder <<<<  -Name Views -Scaffolder MvcScaffolding.Views -SolutionW
ide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidCast 
   Exception
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
 
Set-DefaultScaffolder : Unable to cast object of type 'NuGet.SemanticVersion' to type
 'System.Version'.
At C:\Path\To\My\Project\packages\MvcScaffolding.1.0.6\tools\init.ps1:37 c
har:22
+ Set-DefaultScaffolder <<<<  -Name Action -Scaffolder MvcScaffolding.Action -Solutio
nWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidCast 
   Exception
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
 
Set-DefaultScaffolder : Unable to cast object of type 'NuGet.SemanticVersion' to type
 'System.Version'.
At C:\Path\To\My\Project\packages\MvcScaffolding.1.0.6\tools\init.ps1:38 c
har:22
+ Set-DefaultScaffolder <<<<  -Name UnitTest -Scaffolder MvcScaffolding.ActionUnitTes
t -SolutionWide -DoNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidCast 
   Exception
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
 
Set-DefaultScaffolder : Unable to cast object of type 'NuGet.SemanticVersion' to type
 'System.Version'.
At C:\Path\To\My\Project\packages\MvcScaffolding.1.0.6\tools\init.ps1:42 c
har:22
+ Set-DefaultScaffolder <<<<  -Name View -Scaffolder $viewScaffolder -SolutionWide -D
oNotOverwriteExistingSetting
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], InvalidCast 
   Exception
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet
 
Successfully added 'MvcScaffolding 1.0.6' to NameOfMyProject.
Successfully uninstalled 'MvcScaffolding 1.0.2'.
Successfully uninstalled 'T4Scaffolding 1.0.3'.
Jan 10, 2012 at 3:18 PM

Uninstall  Nuget

install Nuget

and

Install-Package MVCScaffolding