Error creating MVC View

Topics: ASP.NET MVC
Feb 12, 2014 at 9:01 PM
When trying to create a new view in the Views folder of an MVC 5.1 project, I am using the Add View dialog to do so. When I click Add I get an error stating "There was an error running the selected code generator: 'Value does not fall within expected range.'"

All my other projects work fine.

Any Ideas?
Feb 12, 2014 at 11:30 PM
Hi,

I tried this with VS 2013 RTM and was not able to repro this. Can you send me the exact repro steps? Would it be possible to share a sample MVC project that is giving you this error? This will help us narrow down the issue on our end.

Here is what I tried:
  1. Created an MVC project in VS 20913 RTM.
  2. Installed MVC 5.1.0 via nugget.
  3. Right Click on Views folder and invoked Add->View.
  4. This launches the Add View dialog.
  5. Under Template I selected Empty (without Model). I also tried generating a Create view pointing to a model.
Thanks,
Reshmi
Feb 13, 2014 at 3:25 AM
I will see what I can do. I didn't expect anyone to be able to easily repro this. I was hoping someone could give me some ideas on what might be happening based on experience or first hand knowledge of how Visual Studio creates a View using the Add View dialog.
Feb 13, 2014 at 4:56 AM
Also just now found out that that the Add Controller dialog also throws the same error. Any ideas would be greatly appreciated.
Feb 14, 2014 at 2:01 AM
Well, it seems to have worked itself out. Still don't know what the problem was.
Apr 20, 2014 at 1:19 PM
I have the same issue, I even remove the MVC package and reinstall