Visual Studio - The key combination (ctrl+m, ctrl+c) is bound to command (Controller...) which is not currently available - visual-studio

I am trying to create a new asp.net MVC 4 web application, using the asp.net tutorial.
I create a new project selecting ASP.NET MVC 4 Web Application. But when I tried to add a new controller, first, I didn't find the "Controllers" folder, I created one, and when i tried to add new Controller, I couldn't find that option. I clicked Ctrl+M, Ctrl+C so i got this message: The key combination (ctrl+m, ctrl+c) is bound to command (Controller...) which is not currently available
Note that I'm using Visual Studio 2012 Premium.
Does anyone have any idea about this?
Thanks in advance :)

Could it be you didn't select the "ASP.NET MVC 4 Web Application" template when creating a new project. I just tested: the controller folder is there, even when i selected empty template.
So try this: File -> New -> Project and type in the 'Search installed Templates' searchbox "MVC 4". Select "ASP.NET MVC 4 Web Application".

Related

.NET Core can't add Razor pages

As you can see with the images above when I go to add a new razor page instead of taking me to the razor page prompt it instead takes me to add new item and doesn't let me add a razor page. Does anyone know why this is caused? I also need to use an empty razor page for this project.
You have to make sure you have the "ASP.NET and web development" workload installed within Visual Studio.
In Visual Studio go to Tools -> Get Tools and Features...
and make sure "ASP.NET and web development" is ticked and then click Modify / Install.
I had the exact same problem and managed to fix it by following the above steps.

Don't have MVC 5 in VS2013, why?

I want to create a C# MVC Project, so I choose ASP.NET Web Application. After I select it, there should an option to select MVC. But no. I only have Empty, WebForms and Azure Mobile Service. What about MVC? It should be there. I'm using VS2013 Ultimate Update 4. Thanks.
Start by selecting "ASP.NET Web Application", click on "OK".
You'll then be presented with this dialogue:
Where you can choose to select the template you want (in this case, MVC).

where is ASP.NET Web Forms Site in Visual Studio 2010?

Is it possible to create an ASP.NET Web Forms Site in Visual Studio 2010? When I go to File > New > Web Site there is no option to create an ASP.NET Web Forms Site. The 2 closest things to it are: ASP.NET Empty Web Site and ASP.NET Web Site.
You must choose File => New => Project... instead and not File => New => Web Site....
Then select the Visual C# / Web Templates group on the left, and then choose the “ASP.NET Web Application” template in the center column. Name your project and press the OK button.
http://www.asp.net/web-forms/tutorials/tailspin-spyworks/tailspin-spyworks-part-1

How do I set something in Visual Studio 2013 Express for Web so that running it in debug mode opens home page?

Running Razor, MVC5, .Net 4.5.1. I have no idea what constitutes a "start page" in MVC within the visual studio development environment. How do I set it so that every time I run F5 my home page opens?
Setting a startup page for MVC5 when debugging
This can be done in the Project Properties.
Open Solution Explorer and find the relevant project.
Right-click on the project and choose Properties (or press Alt+Enter).
Navigate to Web -> Start Action.
Explanation
By default an MVC application has the Specific Page radio button selected and the input box is blank. This means that the application will open a browser to the server with no page specified and MVC will use the default route of /Home/Index.
http://localhost:12345/
You can specifiy a different route. For example you could use Home/About (see image).
This would open
http://localhost:123456/Home/About

Creating a wizard in C#

I would like to create a wizard to guide a user through some steps in order to create a document based on a template. I found this solution in msdn:
http://msdn.microsoft.com/en-us/library/7k3w6w59(v=vs.80).aspx
The problem is that this tutorial creates a wizard as a New Item or New Project in Visual Studio. But I would like a standalone application, one in which my user can run the wizard without having Visual Studio.

Resources