Upgrading an ASP.NET MVC 2 Project to ASP.NET MVC 3 Tools Update
ASP.NET MVC 3 can be installed side by side with ASP.NET MVC 2 on the same computer, which gives you flexibility in choosing when to upgrade an ASP.NET MVC 2 application to ASP.NET MVC 3.
To manually upgrade an existing ASP.NET MVC 2 application to version 3, do the following:
- Create a new empty ASP.NET MVC 3 project on your computer. This project will contain some files that are required for the upgrade.
- Copy the following files from the ASP.NET MVC 3 project into the corresponding location of your ASP.NET MVC 2 project. You'll need to update any references to the jQuery library to account for the new filename ( jQuery-1.5.1.js):
- /Views/Web.config
- /packages.config
- /scripts/*.js
- /Content/themes/*.*
- Copy the packages folder in the root of the empty ASP.NET MVC 3 project solution into the root of your solution, which is in the directory where the solution’s .sln file is located.
- If your ASP.NET MVC 2 project contains any areas, copy the /Views/Web.config file to the Views folder of each area.
- In both Web.config files in the ASP.NET MVC 2 project, globally search and replace the ASP.NET MVC version. Find the following:
System.Web.Mvc, Version=2.0.0.0
Replace it with the following:
System.Web.Mvc, Version=3.0.0.0
- In Solution Explorer, delete the reference to System.Web.Mvc (which points to the DLL from version 2), then add a reference toSystem.Web.Mvc (v3.0.0.0).
- Add a reference to System.Web.WebPages.dll and System.Web.Helpers.dll. These assemblies are located in the following folders:
- %ProgramFiles%\ Microsoft ASP.NET\ASP.NET MVC 3\Assemblies
- %ProgramFiles%\ Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies
- In Solution Explorer, right-click the project name and select Unload Project. Then right-click the project name again and select Edit ProjectName.csproj.
- Locate the ProjectTypeGuids element and replace {F85E285D-A4E0-4152-9332-AB1D724D3325} with {E53F8FEA-EAE0-44A6-8774-FFD645390401}.
- Save the changes, right-click the project, and then select Reload Project.
- In the application’s root Web.config file, add the following settings to the assemblies section.
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35" /> - If the project references any third-party libraries that are compiled using ASP.NET MVC 2, add the following highlightedbindingRedirect element to the Web.config file in the application root under the configuration section:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc"
publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
Upgrading an ASP.NET MVC 2 Project to ASP.NET MVC 3 Tools Update的更多相关文章
- ASP.NET Core: Getting Started with ASP.NET MVC Core
1. ASP.NET Core the Unified Framework ASP.NET Core的统一框架 2. New Solution Project 新的解决方案项目 src folder: ...
- List多个字段标识过滤 IIS发布.net core mvc web站点 ASP.NET Core 实战:构建带有版本控制的 API 接口 ASP.NET Core 实战:使用 ASP.NET Core Web API 和 Vue.js 搭建前后端分离项目 Using AutoFac
List多个字段标识过滤 class Program{ public static void Main(string[] args) { List<T> list = new List& ...
- how to create an asp.net web api project in visual studio 2017
https://docs.microsoft.com/en-us/aspnet/web-api/overview/getting-started-with-aspnet-web-api/tutoria ...
- ASP.NET Core 中文文档 第四章 MVC(01)ASP.NET Core MVC 概览
原文:Overview of ASP.NET Core MVC 作者:Steve Smith 翻译:张海龙(jiechen) 校对:高嵩 ASP.NET Core MVC 是使用模型-视图-控制器(M ...
- 七天学会ASP.NET MVC (一)——深入理解ASP.NET MVC
系列文章 七天学会ASP.NET MVC (一)——深入理解ASP.NET MVC 七天学会ASP.NET MVC (二)——ASP.NET MVC 数据传递 七天学会ASP.NET MVC (三)— ...
- [ASP.NET MVC 小牛之路]01 - 理解MVC模式
本人博客已转移至:http://www.exblr.com/liam PS:MVC出来很久了,工作上一直没机会用.出于兴趣,工作之余我将展开对MVC的深入学习,通过博文来记录所学所得,并希望能得到各 ...
- 6、ASP.NET MVC入门到精通——ASP.Net的两种开发方式
本系列目录:ASP.NET MVC4入门到精通系列目录汇总 目前,ASP.NET中两种主流的开发方式是:ASP.NET Webform和ASP.NET MVC.从下图可以看到ASP.NET WebFo ...
- 003. Asp.Net Routing与MVC 之一: 请求如何到达MVC
基础知识 本文用到的基础知识:URL.HttpModule 与 HttpHandler.IIS 的请求处理过程. URL HttpModule与HttpHandler IIS7.0的请求处理过程 OK ...
- ASP.NET MVC 随想录——开始使用ASP.NET Identity,初级篇
在之前的文章中,我为大家介绍了OWIN和Katana,有了对它们的基本了解后,才能更好的去学习ASP.NET Identity,因为它已经对OWIN 有了良好的集成. 在这篇文章中,我主要关注ASP. ...
随机推荐
- [解读REST] 5.Web的需求 & 推导REST
衔接上文[解读REST] 4.基于网络应用的架构风格,上文总结了一些适用于基于网络应用的架构风格,以及其评估结果.在前文的基础上,本文介绍一下Web架构的需求,以及在对Web的关键协议进行设计和改进的 ...
- bzoj 2243 [SDOI2011]染色(树链剖分+线段树合并)
[bzoj2243][SDOI2011]染色 2017年10月20日 Description 给定一棵有n个节点的无根树和m个操作,操作有2类: 1.将节点a到节点b路径上所有点都染成颜色c: 2.询 ...
- javascrip实现:若选中TreeView的父节点checkbox,则其子节点全部选中;子节点全部没选中,则父节点也会没选中。
<script type="text/javascript"> function public_GetParentByTagName(element, tagName) ...
- 开发人员的福音:微软、谷歌、Mozilla将他们所有的web API文档放在同一个地方
Tips 原文作者:Liam Tung 原文地址:Developers rejoice: Microsoft, Google, Mozilla are putting all their web A ...
- Tirp(状压DP)
Description 有一个N*N的迷宫,其中有一些宝藏,现在,小A要从入口(1,1)出发,到达出口(N,N),每次,小A只能从当前的格子走到上下左右四个格子,为了不空手而归,小A决定要拿到所以的宝 ...
- LINUX 笔记-重定向 :<,<<,>,>>
command>filename 把标准输出重定向到一个新文件中 command>>filename 把标准输出重定向到一个文件中(追加) command 1>filena ...
- 【ASP.NET MVC 学习笔记】- 01 理解MVC模式
本文参考:http://www.cnblogs.com/willick/p/3195560.html 1.MVC模式是软件系统的一种架构模式,它将软件分为三大模块: 模型(Model):封装业务逻辑以 ...
- 正则和grep——再做正则就去死
grep 文本过滤工具 基本正则表达式 grep 语法 基本正则表达式的元字符 次数匹配 位置锚定 分组 扩展正则表达式 基本正则表达式的元字符 次数匹配 位置锚定 分组 或者 grep的介绍 lin ...
- 写给想成为前端工程师的同学们 ―前端工程师是做什么的?a
前端工程师是做什么的? 前端工程师是互联网时代软件产品研发中不可缺少的一种专业研发角色.从狭义上讲,前端工程师使用 HTML.CSS.JavaScript 等专业技能和工具将产品UI设计稿实现成网站产 ...
- Java:什么是面向对象?
1.首先我们去区分对象的属性和方法. 一).什么是对象? 比如:所有的东西都可以叫做对象.而对象就是提供给我们研究对象,这就是对象. 二).怎么区分"属性"和"方法&qu ...