6

If I right click an MVC website project and choose Add->Area... then type in the area name and hit "Add". I get :

"There was an error running the selected code generator: 'Value does not fall within the expected range'"

All my colleagues also have the same issue.

Can anyone shed light on this?

Liam
  • 27,717
  • 28
  • 128
  • 190
chrisp_68
  • 1,731
  • 23
  • 41

3 Answers3

8

I was stuck with the same issue and found a solution. It means your solution does not have web.config file.

Liam
  • 27,717
  • 28
  • 128
  • 190
Smit
  • 609
  • 3
  • 11
  • 27
  • 1
    This was appears to be the cause for me. I had deleted the web.config (complicated reason but it's to do with the type of app I was building). The web.config appears to contain nothing exciting but the fact that the web.config is missing seems to break something. Possibly a visual studio bug. – Liam Jul 08 '15 at 14:20
4

You can add the area by using the Add -> New Scalfolded item option .

Hope it will help

irfan Munir
  • 151
  • 3
  • 17
  • 1
    I get exactly same result using this method. "There was an error running the selected code generator: 'Value does not fall within the expected range'" – chrisp_68 May 20 '14 at 09:35
  • It should not be as i am using it without any errors. Make sure you are using update 2 of vs2013 . You can check that from tool->extension and updates to verify the available updates. – irfan Munir May 20 '14 at 12:14
  • Thanks for the pointer @irfanMunir, but I'm not even seeing an option there? I'm on 2013 update 2. I even looked "online" through the dialog but couldn't find anything for adding an area to an MVC application. Any ideas? – Hallmanac Jun 18 '14 at 22:35
  • 1
    Figured it out for anyone who comes across this thread... it's due to the fact that I'm in an MVC 3 project running VS 2013 Update 2. I get the option to add an area inside an MVC 5 project but not MVC 3. – Hallmanac Jun 20 '14 at 21:04
0

Create a folder name Areas right click you will see the option to create new Areas More about issue here : https://developercommunity.visualstudio.com/t/add-area-context-menu-option-is-missing-in-aspnet/859536