How do you directly upgrade ASP.NET MVC1 to MVC3? - asp.net-mvc

I have an ASP.NET MVC1 project and want to upgrade it directly to MVC3. I assume that there are two paths:
Upgrade directly from 1 to 3
Upgrade to 2 and then do a second upgrade to 3
Which is the path most traveled?

If you are using the ASP.NET Project upgrade tool you can only do the second path right now as stated in this blog:
The tool does not support Visual Studio 2008 solutions, MVC 1 projects, or projects targeting .NET 3.5. If you have a MVC 1.0 project you can use the old version of this tool to convert it to MVC 2.
I'm assuming you could manually upgrade directly to MVC 3, but why go through the hassle when you can run two wizards to upgrade the project for you.

Related

Upgrade MVC1 project to MVC5

Is there a way to convert a ASP.Net MVC 1 project build in VS2008 to ASP.Net MVC 5 and VS2015?
I tried to just open it in VS 2015 but that gave the error "This project is incompatible with the current version of Visual Studio".
There are ways to reference newer versions and update, eg:
http://www.asp.net/mvc/overview/releases/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2
.. however updating from MVC1 (especially if you cannot open the project) you probably don't want to manually install ASP.NET MVC installs etc (if that what I remember)
I would suggest creating a new MVC5 application, referencing MVC via Nuget etc and pulling in code as required. This will give you a chance to re-structure things and learn newer ways otherwise you my be fighting with MVC configuration and references.

System.Web.WebPages.Razor 3.0.0 missing

I would like to add reference to my ASP.NET MVC4 project, but in Add reference dialog (Assemblies->Extensions), there are only version 1.0 and 2.0 of System.Web.WebPages.Razor.dll
I have installed Visual Studio Professional 2013 and ASP.NET MVC4 from Web Platform Installer. What I am missing.
The web application does not work without this reference and complains that it cannot find System.Web.WebPages.Razor.dll 3.0
Razor 3.0 is only compatible with MVC 5. In your question, you stated that you are using MVC 4, which is only compatible with Razor 2.0.
So, the real question is, why are you trying to add Razor 3.0 to MVC 4? Either stick with Razor 2.0, or upgrade your project to MVC 5.
If you have a project dependency that was designed for MVC 5 (and Razor 3.0), you might be getting this error. The same advice goes for the dependency - either change it to use Razor 2.0 and MVC 4 (assuming you can make changes to it), or upgrade the project that requires the dependency to MVC 5.

Can I open dot Net MVC project in VS 2013?

We have a very old legacy system which was developed using MVC1 through Visual Studio. Since then , Visual Studio also evolved and so has MVC.
Now we want to make our MVC1 project compliant with MVC5. Is there any, ready made tool available for this?
Various forums suggest to gradually move the project from MVC1 to MVC2, then from MVC2 to MVC3 and so on.
But I was not able to find any way of converting from MVC1 to MVC2. Although the information regarding the same is still available, but the tool to convert MVC1 to MVC2 is not found.
Can any one please throw some light on this?
You can use the old version of ASP.NET Project upgrade tool as the limitation is
The tool does not support Visual Studio 2008 solutions, MVC 1 projects, or projects targeting .NET 3.5. If you have a MVC 1.0 project you can use the old version of this tool to convert it to MVC 2.
You can also manually upgrade to MVC 3
The white paper steps for upgrading MVC1.0 to MVC2.0 are
Fiddle with web.csproj
Replace Version=1.0.0.0 in web.config by Version=2.0.0.0
Reference System.Web.Mvc (v2.0.0.0) in the project
chnange bindingRedirect in web.config
update css and js files

Is ASP.NET MVC 5 released or not?

According to Wikipedia - asp.NET MVC 5 was released on 17th October 2013.
However on the ASP Website I can't see where to download the package.
When I try to create a new Project in VS 2013 - I can only choose asp.NET MVC 4.
How can I install MVC 5 ?
In Visual Studio 2013, the MVC project wizard was merged with the ASP.NET Web Application Wizard. When you target .NET 4.5, select the ASP.NET project. You will be presented with a new wizard that will allow you to select a base template and then customize it further by adding support for Web API or MVC. It also allows you to customize the authentication/authorization model you wish to use in your application.
The MVC 4 wizard is still present under the VS 2012 node in the New Project dialog.
Runtime packages for MVC 5, Web API 2, and Web Pages 3 were published to nuget.org, so you can upgrade existing projects.
You can also download a separate installer for Visual Studio 2012 that will allow you to create an MVC 5 and Web API 2 project, albeit empty. Once you have the project created you will be able to add views and controllers using the new scaffolding. The download for the Visual Studio 2012 support can be found at here
Thanks,
Jacques
From the nuget site:
Microsoft ASP.NET MVC 5.0.0
To install Microsoft ASP.NET MVC, run the following command in the Package Manager Console
PM> Install-Package Microsoft.AspNet.Mvc
You can download it directly from this link:
http://www.asp.net/mvc/mvc5
You can find all versions of latest MVC from below nuget
http://www.nuget.org/packages/Microsoft.AspNet.Mvc

ASP.net MVC 3 project files not showing up in new project dialog?

I installed ASP.net MVC 3 on my dev machine yesterday using the web-based installer, did a clean reboot, etc.
The MVC 3 projects still don't appear in my New Project dialog, only the MVC 2 ones. Am I missing a step?
The answer (in this case): Make sure you have the .net 4 runtime selected at the top of the new project dialog.
If you're using Visual Studio 2008, it won't show up since it's available for VS 2010 / .NET 4 only. If however you are using VS 2010 and .NET 4, they should appear unless something wonky occurred with the install.

Resources