How to add MVC5 to Visual Studio 2013?

2019-01-12 18:31发布

I'm starting a new project, and would like to give a try to MVC 5 (I have built a web app using MVC 4 before).

In Visual Studio 2013, I click the New Project and navigate to Visual C# > Web > Visual Studio 2012 (even though I have installed VS 2013 it says 2012 in the menu) and on that list I only have MVC 4 application - not 5.

The framework in the drop down menu is set to .NET Framework 4.5.1 - and still nothing.

I've checked Tools > Extensions and Update and searched for MVC 5 - but it doesn't find anything official from Microsoft.

How can I add MVC 5 to my Visual Studio 2013?

Thank you

8条回答
啃猪蹄的小仙女
2楼-- · 2019-01-12 18:40

Go File -> New Project.

Select Web under Visual C#.

Select ASP.NET Web Application

Click OK.

New Project Dialog

Select MVC.

Click OK.

ASP.Net Dialog

查看更多
Anthone
3楼-- · 2019-01-12 18:41

MVC 5 is already built into Visual Studios 2013.

  1. Open a new project, on the left make sure you are under Templates > Visual C# > Web not Templates > Visual C# > Web > Visual Studios 2012.

  2. Important: Now look near the top of the new project dialog box and select .NET 4.5 or higher. Once under web and the proper framework is selected click ASP.NET Web Application in the middle pane. Click OK

  3. This will bring you to a page where you can select MVC as the project and start the wizard.

查看更多
做个烂人
4楼-- · 2019-01-12 18:43

Select web development tools when you install the visual studio 2013. Then it will work properly and show the asp.net web applicaton.

查看更多
我只想做你的唯一
5楼-- · 2019-01-12 18:47

You can look into Windows installed folder from here of your pc path:

C:\Program Files (x86)\Microsoft ASP.NET

View of Opened file where showing installed MVC 3, MVC 4

enter image description here

查看更多
狗以群分
6楼-- · 2019-01-12 18:57

With respect to other answers, it's not always there. Sometimes on setup process people forget to select the Web Developer Tools.

In order to fix that, one should:

  1. Open Programs and Features find Visual Studios related version there, click on it,
  2. Click to Change. Then the setup window will appear,
  3. Select Web Developer Tools there and continue to setup.

It will download or use the setup media if exist. After the setup windows may restart, and you are ready to have fun with your Web Developer Tools now.

查看更多
Evening l夕情丶
7楼-- · 2019-01-12 19:00

Visual Studio 2013 no longer has separate project types for different ASP.Net features.

You must select .NET Framework 4.5 (or higher) in order to see the ASP.NET Web Application template (For ASP.NET One).
So just select Visual C# > Web > ASP.NET Web Application, then select the MVC checkbox in the next step.

Note: Make sure not to select the C# > Web > Visual Studio 2012 sub folder.

查看更多
登录 后发表回答