开发者

How do I upgrade my asp.net mvc2 project to asp.net mvc3 in Visual Studio 2010?

I have started the pro开发者_高级运维cess of upgrading my mvc projects from 2 to 3 using this guide: http://mattsieker.com/index.php/2010/11/21/converting-asp-net-mvc2-project-to-mvc3/.

So far, I have just removed the old reference to system.web.mvc. When I looked for System.Web.MVC (version 3) it wasn't listed. I could only find version 2.

I know that I have 3 installed. I used the web platform installer to download and install mvc3. In VS2010 I do have the option to make an MVC3 project.

How do i add the reference to system.web.mvc V3? Where do i look?


Re-target your web project for .NET 4.0 before being able to see System.Web.Mvc, Version 3.0.0.0 in the references list.


There is a tool that you can use to upgrade your projects. You just point it at the .csproj file and it will update your project to ASP.NET MVC 3:

http://blogs.msdn.com/b/marcinon/archive/2011/01/13/mvc-3-project-upgrade-tool.aspx


You should follow this:

http://www.asp.net/learn/whitepapers/mvc3-release-notes#upgrading

This is very good instruction and definitely more detailed.


I had the same problem mentioned above where I installed MVC 3 and couldn't find the reference to System.Web.MVC version 3.0.0.0 in the add references dialog. The solution was simple: The assemblies in the dialog box weren't all ordered alphabetically, so I actually did have the appropriate reference to System.Web.Mvc available in the dialog, but it was shown out of order.

I scrolled down in the list past the section with the other System.Web dlls and eventually found System.Web.MVC, version 3.0.0.0.

I am using Visual Web Developer Express 2010.

EDIT: The "Add References" dialog in VS has sortable columns, so if you sort by name it helps in situations like this. It's confusing that VS doesn't sort the assemblies in name order by default, but now you know.


in best practice you need a tool who someone made on MSDN especially for upgrade MVC 2 project to MVC 3.

the thing you need to check that :-

the all dll should be update if you confused just create new MVC 3 project and check out all dll a MVC 3 project should have.

you need to check that target to MVC 3 in both web.config :- first stored in main directory and second in Views directory

it is enough to solve the situation when upgrade from MVC 2 to MVC 3

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜