Exception on "Add Controler" in ASP.NET MVC project - by AbydosLLC

Status : 

  Not Reproducible<br /><br />
		The product team could not reproduce this item with the description and steps provided.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


1
0
Sign in
to vote
ID 800847 Comments
Status Closed Workarounds
Type Bug Repros 1
Opened 9/15/2013 10:36:50 PM
Access Restriction Public

Description

I have an ASP.NET MVC Project. When I right-click on the "Controllers"-Directory in the Solution Explorer an select "Add -> Controler" i get following exception:

Unable to cast object of type 'System.Management.Automation.PSCustomObject' to type 'System.Collections.IEnumerable'.
Sign in to post a comment.
Posted by DavidHLau on 9/24/2014 at 12:55 PM
I was able to reproduce this error, fix it, and reproduce it again...I wanted to switch between EntityFramework v5 & 6 for MVC4 & 5, and came across this error.

Steps:

1) I performed a clean install of Visual Studio 2012 Ultimate (Default EntityFramework is version 5.0.0)

2) PMC > Install-Package EntityFramework -version 6.1.1 (Success)

3) PMC > Install-Package MvcScaffolding (Success)

4) PMC > Uninstall-Package EntityFramework -version 6.1.1

* Note: This requires you to uninstall dependency packages in this order:

Uninstall-Package MvcScaffolding -version 1.0.9

Uninstall-Package T4Scaffolding -version 1.0.8

4) Install-Package EntityFramework -version 5.0.0 (Reinstall, Success)

5) Go to /Controller/ folder and "Add" Controller => ERROR MESSAGE

Note: If you try to reinstall these dependency files it will automatically uninstall version 5.0.0 and reinstall version 6.1.1

MvcScaffolding -version 1.0.9 & T4Scaffolding -version 1.0.8

Repair Options:

#1 Go to control panel "Uninstall" VS12 and select "Repair"

#2 Uninstall VS12 and reinstall a clean copy

I also performed a clean install of Visual Studio 2013 Ultimate (Default EntityFramework is version 6.1.1) and switched between EntityFramework v5 & 6 for MVC4 & 5...same error message.
Posted by LowTide on 12/19/2013 at 9:46 AM
I have the exact same problem. Created new ASP.NET MVC4 Template Project, Internet Application using Razor ViewEngine. I right click on Models and choose Add Model, and this error shows. However, I can right click, choose add item, go to MVC and choose controller and it works.
Posted by Microsoft on 11/22/2013 at 2:06 PM
Thanks for checking on this issue, Brian. Can you please share your repro with us? We still don't have a repro project here.

ASP.NET Team
Posted by brianwatson on 10/25/2013 at 1:05 PM
I have the exact same problem. Created new ASP.NET MVC4 Template Project, Internet Application using Razor ViewEngine. Successfully added a class in Model and moved to add a Controller but got the same error as in this thread. Was a solution found?
Posted by Microsoft on 9/19/2013 at 8:42 PM
Hello again. We wanted to give you a quick reminder that to efficiently investigate and reproduce your issue, we need you submit the additional information we requested. We look forward to hearing from you with this information.
Posted by Microsoft on 9/16/2013 at 6:36 AM
Thanks for your feedback. In order to efficiently investigate and reproduce this issue, we are requesting additional information outlined below.

Could you please give us a demo project so that we can conduct further research?

Please submit this information to us within 4 business days. We look forward to hearing from you with this information.

Microsoft Visual Studio Connect Support Team
Posted by Microsoft on 9/15/2013 at 10:51 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)