• vs2013(vs2015) 打开vs2010 找不到此项目类型所基于的应用程序 MVC2 升级 MVC5 不能加载Web项目


    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.
     ASP.NET MVC 3可以与ASP.NET
    MVC 2同时安装在同一台电脑上,让你可以灵活地选择何时升级ASP.NET MVC 2应用程序到ASP.NET
    MVC 3版本。

    To manually upgrade an existing ASP.NET MVC 2 application to version 3, do the following:  若要手动升级版本,执行以下操作

    1. 在电脑上新建一个空的ASP.NET MVC 3项目。此项目包含一些升级所必须的文件。
    2. 从 下面的ASP.NET
      MVC 3 项目中的文件复制到您的 ASP.NET MVC 2 项目的相应位置中。你需要更改所有对jQuery library的引用去适应新的文件名( jQuery-1.5.1.js)
      • /Views/Web.config
      • /packages.config
      • /scripts/*.js
      • /Content/themes/*.* 
    3. 复制空ASP.NET MVC 3项目的packages文件夹到你自己解决方案根目录里(.sln文件所在的目录)
    4. 复制MVC2 项目 in 下的所有文件 到packages文件夹。
    5. 如果你的ASP.NET MVC 2项目包含了其他区域,复制/Views/Web.config文件到所有区域的Views文件夹目录下
    6. 在ASP.NET MVC 2 Web项目中的Web.config 文件内,在全局范围内搜索并替换的ASP.NET MVC 的版本号。找到以下内容:
      System.Web.Mvc, Version=2.0.0.0

      Replace it with the following:  作如下修改

      System.Web.Mvc, Version=3.0.0.0
    7. 在应用程序的根目录下的Web.config文件中添加以下设定到 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" />
    8.   在解决方案资源管理器中删除(指向版本2的动态链接库的)对System.Web.Mvc的引用,然后添加一个对System.Web.Mvc(版本3)的引用
    9.   Web.config中添加对System.Web.WebPages.dll 和 System.Web.Helpers.dll的引用这些程序集位于下面的文件夹:
      • %ProgramFiles% Microsoft ASP.NETASP.NET MVC 3Assemblies
      • %ProgramFiles% Microsoft ASP.NETASP.NET Web Pagesv1.0Assemblies
      1. MVC 2框架下编译的第三方库,在Web项目中的Web.config文件的configuration section下添加下面高亮的bindingRedirect 元素
        <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>
      2. <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>

    10.  编辑Web项目的  项目名.csproj  这个文件找到ProjectTypeGuids标记, 
      并将{F85E285D-A4E0-4152-9332-AB1D724D3325}替换成 {E53F8FEA-EAE0-44A6-8774-FFD645390401}
    11. 对比MVC5 Web项目 下的.csproj  和MVC2 Web项目下的.csproj文件,将可能的不同都修改一下
    12. 修改改 Reference 的路径到 Packages
    13.  保存修改,再次右击项目,然后选择重载项目
    14. http://files.cnblogs.com/files/xdot/csprojDif.rar
  • 相关阅读:
    Atitit.异步编程技术原理与实践attilax总结
    AjaxToolKit之Rating控件的使用(http://www.soaspx.com/dotnet/ajax/ajaxtech/ajaxtech_20091021_1219.html)
    JavaScript初学指南
    javascript泛型集合类(转)
    HTTP 错误 404.2 Not Found 由于 Web 服务器上的“ISAPI 和 CGI 限制”列表设置,无法提供您请求的页面
    IIS连接oralce数据库时 提示“System.Data.OracleClient 需要 Oracle 客户端软件 8.1.7 或更高版本”
    配置错误定义了重复的“system.web.extensions/scripting/scriptResourceHandler” 解决办法
    self.location.href的具体用法(转)
    CSS Overflow属性详解(转)
    .net中使用showModalDialog打开模式窗口,在后台代码中使用Response.Write()会弹出新页面
  • 原文地址:https://www.cnblogs.com/xdot/p/5966405.html
Copyright © 2020-2023  润新知