Upgrading an ASP 2 Project to ASP 3 Tools Update
ASP. NET MVC 3 can be installed side by side with ASP. 2 on the same computer, which gives you flexibility in Choosi ng when to upgrade an ASP 2 application to ASP 3.
ASP. NET MVC 3 can be used with ASP.
MVC 2 is installed on the same PC at the same time, giving you the flexibility to choose when to upgrade ASP. NET MVC 2 applications to ASP.
MVC version 3.
To manually upgrade an existing ASP 2 application to version 3, do the following: To manually upgrade the version, do the following
- Create a new empty ASP. NET MVC 3 project on your computer. This project contains some files that you must have to upgrade.
- From the following ASP.
The files in the MVC 3 project are copied to the appropriate location in your ASP. NET MVC 2 Project . you need to change all references to the JQuery library to accommodate the new file name (jquery-1.5.1.js)
- /views/web.config
- /packages.config
- /scripts/*.js
- /content/themes/*.*
- Copy the Packages folder of an empty ASP. NET MVC 3 project into your own solution root catalog (the directory where the. sln file resides)
- Copy all files under MVC2 project \ Bin to the Packages folder.
- If your ASP. NET MVC 2 project contains other zones, copy the/views/web.config file to the Views folder directory of all regions
- Find the following:
system. Web. Mvc, version=2.00.0
Replace it with the following: make the following changes
system. Web. Mvc, version=3.00.0
- web.config file under the root of the application, add the following settings to assemblies section
<addassembly="System.Web.WebPages, version=1.0.0.0, Culture=neutral, publickeytoken= 31bf3856ad364e35 "/><addassembly=" System.Web.Helpers, version=1.0.0.0, culture= Neutral, publickeytoken=31bf3856ad364e35 "/>
- Remove the reference to SYSTEM.WEB.MVC (to the dynamic-link library for version 2) in Solution Explorer, and then add a reference to SYSTEM.WEB.MVC (version 3)
- add a reference to System.Web.WebPages.dll and System.Web.Helpers.dll in Web. config. These assemblies are located in the following folder:
- %programfiles%\ Microsoft asp.net\asp.net MVC 3\assemblies
- %programfiles%\ Microsoft asp.net\asp.net Web pages\v1.0\assemblies
-
- A third-party library compiled under the MVC 2 framework that adds the following highlighted BindingRedirect element under the configuration section of the Web. config file
<runtime><assemblybinding xmlns="Urn:schemas-microsoft-com:asm.v1"><dependentAssembly> <assemblyidentity name= "SYSTEM.WEB.MVC" Publickeytoken= "31bf3856ad364e35" /><bindingredirect oldversion< Span class= "pun" >= "1.0.0.0-2.0.0.0" newversion = "3.0.0.0" /> </dependentassembly> </assemblybinding> </RUNTIME>
<runtime>
<assemblybinding xmlns= "Urn:schemas-microsoft-com:asm.v1" >
<dependentAssembly>
<assemblyidentity name= "SYSTEM.WEB.MVC" publickeytoken= "31bf3856ad364e35"/>
<bindingredirect oldversion= "1.0.0.0-5.0.0.0" newversion= "5.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
- Edit the project name of the Web project. csproj This file finds the projecttypeguids tag,
and replace {f85e285d-a4e0-4152-9332-ab1d724d3325} with {e53f8fea-eae0-44a6-8774-ffd645390401}
- Compare the. csproj files under the. csproj and MVC2 Web projects under the MVC5 Web project to modify the possible differences
- Modify the path of the Reference to Packages
- Save the changes, right-click the project again, and select Reload Project
- Http://files.cnblogs.com/files/xdot/csprojDif.rar
vs2013 Open VS2010 cannot find the application that this project type is based on MVC2 upgrade MVC5 cannot load Web project