Forcing Visual Studio 2013 to use ASP.NET MVC 5.1, ASP.NET Web API 2.1 and ASP.NET Web Pages 3.1

        Introduction:



                   DISCLAIMER: This was done completely for my own benefit, but I thought this might be useful to others, so I am sharing my work with you. But please backup your files before replacing.

                    A few days ago, Microsoft announced the release of ASP.NET MVC 5.1, ASP.NET Web API 2.1 and ASP.NET Web Pages 3.1 and Visual Studio 2013 Update 1. We can now create ASP.NET MVC 5.1, ASP.NET Web API 2.1 and ASP.NET Web Pages 3.1 application by creating a new web application and update the released NuGet packages(means running Install-Package Microsoft.AspNet.Mvc -Version 5.1.0, Install-Package Microsoft.AspNet.WebApi -Version 5.1.0 and Install-Package Microsoft.AspNet.WebPages -Version 3.1.0). But doing this every time when you create a new web application takes some time and easily forgettable. In this article, I will tell you some quick tips to force Visual Studio 2013 to use the new versions automatically when you create a new web application.  


        Description:

 

 

                    First of all download VS2013TemplatesForMVC5.1WebAPI2.1WebPages3.1. These templates will force Visual Studio 2013 to use MVC 5.1, Web API 2.1, Web Pages 3.1 and Katana(Owin) 2.1. The download zip file includes 3 folders. First, copy/paste the contents of 'C Program Files (x86) Microsoft ASP.NET ASP.NET Web Stack 5 Packages' to C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Stack 5\Packages. Next, copy/paste the contents of 'C Program Files (x86) Microsoft Visual Studio 12.0 Common7 IDE WebTemplates' to C://Program Files (x86)/Microsoft Visual Studio 12.0/Common7/IDE/WebTemplates and finally copy/paste the contents of 'C Program Files (x86) Microsoft Web Tools Packages' to C:\Program Files (x86)\Microsoft Web Tools\Packages. That's it. Now whenever you create a new web application, Visual Studio will use MVC 5.1, Web API 2.1, Web Pages 3.1 and Katana(Owin) 2.1. So, no need to update the NuGet packages.

 

        Summary:


                    Creating a new ASP.NET MVC 5.1, ASP.NET Web API 2.1 and ASP.NET Web Pages 3.1 application might be painful because you need to update the NuGet packages every time you create a new web application. In this article, I showed you how to force Visual Studio 2013 to use the new versions automatically when you create new web application. Hopefully you enjoyed my this article too.



2 Comments

  • Hi Imran,

    Good Idea, but I'm unable to see the template in the new project Template list!

    Files places in the exact proposed location and VS2013 updated to update 1.

    Any suggestion?

  • Hi again,

    I think I misunderstood this, now I understand that selecting new web application as MVC will force to use 5.1 version.

    Thanks

Comments have been disabled for this content.