How do I install ASP.NET MVC 5 in Visual Studio 20

2019-01-13 02:30发布

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?

11条回答
神经病院院长
2楼-- · 2019-01-13 03:27

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...

查看更多
爷的心禁止访问
3楼-- · 2019-01-13 03:28

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.

查看更多
爷的心禁止访问
4楼-- · 2019-01-13 03:32

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.

查看更多
神经病院院长
5楼-- · 2019-01-13 03:33

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.

查看更多
小情绪 Triste *
6楼-- · 2019-01-13 03:36

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

查看更多
登录 后发表回答