I update the visual studio 2010 project to visual studio 2013. Then I want to ad a new controller. but there is no add Controller option.
But If I create a new project in 2013 it already have the add Controller option. So how to add the new Controller? something missing in web.config or missing reference?
For Visual Studio 2013 (Released Version)Right Click on the "Controllers" folder in your MVC project. Add > Controller... Choose a Controller Template. (I prefer MVC 5 Controller Empty)
Using the Add Controller Menu Option The easiest way to create a new controller is to right-click the Controllers folder in the Visual Studio Solution Explorer window and select the Add, Controller menu option (see Figure 1). Selecting this menu option opens the Add Controller dialog (see Figure 2).
In Solution Explorer, right-click the Controllers folder and then select Add Controller. Name your new controller "HelloWorldController". Leave the default template as Empty MVC controller and click Add. Notice in Solution Explorer that a new file has been created named HelloWorldController.
Create a new controller by right-clicking the Controllers folder in Solution Explorer and then selecting Add Controller. Name your new controller "HelloWorldController" and click Add. Notice in Solution Explorer on the right that a new file has been created for you named HelloWorldController.
Make sure your .proj file includes all the appropriate project type Guids.
<ProjectTypeGuids>{E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
The first GUID allows all standard MVC operations in the context menus.
In my case Unloding and Reloading the project solved the problem. To unload - right click on the project name and choose "Unload Project" from the context menu. Then again right click on the project name and select "Reload Project" from the context menu.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With