How do I install ASP.NET MVC 5 in Visual Studio 2012?
Asked Answered
P

11

114

Is there a way to install ASP.NET MVC 5 in Visual Studio 2012?

I've tried using NuGet (http://www.nuget.org/packages/Microsoft.AspNet.Mvc). But I think that it should come as a Visual Studio extension, but I can't find that anywhere.

Or it is available only in Visual Studio 2013?

Poleyn answered 30/9, 2013 at 20:6 Comment(0)
M
165

Microsoft has provided for you on their MSDN blogs: MVC 5 for VS2012. From that blog:

We have released ASP.NET and Web Tools 2013.1 for Visual Studio 2012. This release brings a ton of great improvements, and include some fantastic enhancements to ASP.NET MVC 5, Web API 2, Scaffolding and Entity Framework to users of Visual Studio 2012 and Visual Studio 2012 Express for Web.

You can download and start using these features now.

The download link is to a Web Platform Installer that will allow you to start a new MVC5 project from VS2012.

Monika answered 20/11, 2013 at 17:7 Comment(12)
I installed it and still only see ASP.NET MVC 4 project.Springs
If you don´t see the ASP.NET MVC 5 project template, you might change the framework version to 4.5 or above...Dunaj
@Poleyn - Please set this as the answer if it worked for you :)Monika
I have also installed this and still only see mvc 4?Bowler
@Poleyn - look two comments up. (From your comment)Monika
I see ASP.NET MVC 5 Empty Project when I switch to .NET Framework 4.5, but only that. I don't see any other flavors. I was hoping for ASP.NET MVC 4 Web Application, which I presume would have the basic setup for using OAuth and connecting to accounts like Google, Facebook, etc.Haile
I had to restart Visual Studio twice for the MVC5 template to appear.Distributor
I have installed it and set to 4.5 but I still cannot see MVC5Pacheco
That package is no longer available in Web Installer. :/Lanner
The package has now been rolled up into ASP.NET and Web Tools 2012.2Nakesha
I spent too much time trying to find the right link. Seems the link above says it does not exist in the package anymore. After searching around, I found this link: microsoft.com/en-us/download/details.aspx?id=41532 and this worked for me.Roadway
This information really helps me, but there's no option to add controllers. When I right click on the Controller folder and click on Add, there's no option to choose Controller. There's only the option to add Web Api ControllerVidda
O
10

You can use Visual Studio 2012.

Simply update your NuGet package in Visual Studio to Microsoft.AspNet.Mvc 5.0.

You may have to search pre-release.

Also the default project comes with Entity Framework 6.0, and ASP.NET Razor 3.0.

You may also need ASP.NET Identity Core and OWIN.

All of these can be downloaded/updated through menu ToolsLibrary package managerManage NuGet Packages for Solution....

If you don't yet have NuGet, follow this tutorial:

http://docs.nuget.org/docs/start-here/installing-nuget

Oruro answered 18/10, 2013 at 19:21 Comment(1)
This doesn't install ASP.NET MVC 5 related templates.Township
J
10

There are a few installs you may need to apply for ASP.NET MVC 5 support in Visual Studio 2012. Update 4 seems to include the Web Tools update now.

You don't have to install the full Windows 8.1 SDK if you are just looking for the option to build web applications, just the .NET Framework 4.5.1 option in the installer. The full install is about 1.1 GB, but just the .NET installer is only 72 MB.

Jeanajeanbaptiste answered 15/12, 2013 at 17:1 Comment(4)
It looks like VS2012 update 4 "applies" the Microsoft ASP.NET and Web Tools 2012.3", so maybe that's all that is needed now. I didn't see if it was also getting .net 4.5.1. I will know as it finishes downloadingPiddock
Maybe they fixed the update 4. Originally, it still required the additional tools install.Jeanajeanbaptiste
I forgot to write back, but all that was required extra was the windows 8.1 sdk for .net 4.5.1, but the asp.net and web tools 2013.1 was included in update 4.Piddock
This is now the correct answer, as the Web Installer link does not have the needed package anymore.Lanner
P
7

I had trouble with the web installer not "finding the product"

The stand alone installer is located here:

https://www.microsoft.com/en-us/download/details.aspx?id=41532

The release/installation notes can be found at

http://www.asp.net/visual-studio/overview/2012/aspnet-and-web-tools-20131-for-visual-studio-2012

Dependency:

  • .NET 4.5
  • You need to select this version of the framework when creating a new project in order to view the MVC 5 project templates.

Included:

  • MVC5
  • Entity Framework 6
  • Web API 2
  • Bootstrap
  • Razor
  • Nuget 2.7
Pressley answered 22/12, 2015 at 9:51 Comment(1)
This information really helps me, but there's no option to add controllers. When I right click on the Controller folder and click on Add, there's no option to choose Controller. There's only the option to add Web Api Controller.Vidda
P
5

Following Microsoft tutorial-upgrade ASP.NET MVC 4 to ASP.NET MVC 5, http://www.asp.net/mvc/tutorials/mvc-5/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2, you can achieve that with one problem that Visual Studio 2012 will not be able to recognize your project as neither ASP.NET MVC 4 nor 5.

It will deal with it as a Web Form project. For example, options such adding a controller will not be there any more...

Paradrop answered 19/10, 2013 at 16:4 Comment(1)
I think I just ran into this issue. Is it possible to get VS2012 to recognize a converted project as a Web Api project again?Briarwood
T
4

Here are the steps to use ASP.NET MVC 5 in Visual Studio 2012:

  • Start your ASP.NET MVC 4 project.
  • Install-Package Microsoft.AspNet.WebApi -pre
  • Install-Package Microsoft.AspNet.Mvc -Pre
  • Install-Package Microsoft.AspNet.SignalR -Pre

These two will update:

  • Microsoft.AspNet.Mvc 5.0.0-rc1
  • Microsoft.AspNet.Razor
  • Microsoft.AspNet.WebApi 5.0.0-rc1
  • Microsoft.AspNet.WebApi.Client 5.0.0-rc1
  • Microsoft.AspNet.WebApi.Core 5.0.0-rc1
  • Microsoft.AspNet.WebApi.WebHost 5.0.0-rc1
  • Microsoft.AspNet.WebPages 3.0.0-rc1
  • and some other goodies

If these upgrades did not update your web.config, then check out this useful page: upgrading from MVC4 to MVC5.

Threaten answered 1/11, 2013 at 17:12 Comment(0)
C
1

You should be able to install from NuGet (http://www.nuget.org/packages/Microsoft.AspNet.Mvc) into VS2012. Change the Target Framework to .NET 4.5.

Not sure the new project templates are ready for VS2012. But if you have an ASP.NET MVC 4 app you can upgrade using the link below.

http://www.asp.net/mvc/tutorials/mvc-5/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2

Choral answered 12/10, 2013 at 10:9 Comment(0)
L
1

FYI. You can now just update VS 2012:

http://blogs.msdn.com/b/webdev/archive/2013/11/18/announcing-release-of-asp-net-and-web-tools-2013-1-for-visual-studio-2012.aspx

"We have released ASP.NET and Web Tools 2013.1 for Visual Studio 2012. This release brings a ton of great improvements, and include some fantastic enhancements to ASP.NET MVC 5, Web API 2, Scaffolding and Entity Framework to users of Visual Studio 2012 and Visual Studio 2012 Express for Web."

Leomaleon answered 10/1, 2014 at 16:15 Comment(0)
G
1

Step 1: Install update http://httpjunkie.com/2013/340/develop-mvc-5-with-asp-net-identity-in-visual-studio-2012/.

OK, so that gets you to be able to start from a blank ASP.NET MVC project, but a lot of people want the FULL INTERNET APPLICATION as shipped with Visual Studio 2013.

So I have a step 2: http://httpjunkie.com/2013/340/develop-mvc-5-with-asp-net-identity-in-visual-studio-2012/

If you follow that tutorial on my website I follow it up with a full install of Foundation 5 and a cool Hybrid OffCanvas/Top-Bar navigation.

Gibbs answered 25/1, 2014 at 21:11 Comment(0)
B
0

If you want to install ASP.NET MVC 5 and ASP.NET Web API 2 into VS 2012 Ultimage so, you can download MSI installer from
http://www.microsoft.com/en-us/download/details.aspx?id=41532.

I have downloaded and intalled just know. I got MVC 5 and Web API 2
:)

Binoculars answered 8/1, 2014 at 11:45 Comment(0)
U
0

This feature is now available for Visual Studio 2012 at Web Platform Installer. Just search for ASP.NET and Web Tools 2012.2.

How to install ASP.NET and Web Tools 2012.2

Unwell answered 20/1, 2016 at 16:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.