问题
After installing Update 4 to Visual Studio 2012, when I try to add a controller right-clicking on the Controllers folder in the Solution Explorer and selecting "Add -> Controler" I am getting following exception:
Unable to cast object of type 'System.Management.Automation.PSCustomObject' to type 'System.Collections.IEnumerable'.
This is how Visual Studio is presenting the error:
This error is happening only for brand new projects, fortunately I am not getting this error in my projects that were in development.
Additional information: The MVC template that I choose was: "Basic", but I got the same problem for "Empty", "Internet Application" and "Intranet Application" templates as well.
回答1:
The solution was restart my PC and allow Windows 8.1 to install pending updates.
来源:https://stackoverflow.com/questions/20029199/unable-to-cast-object-of-type-system-management-automation-pscustomobject-to-t