vs2013 開啟vs2010 找不到此項目類型所基於的應用程式 MVC2 升級 MVC5 不能載入Web項目

來源:互聯網
上載者:User

標籤:

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 項目 \bin 下的所有檔案 到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.NET\ASP.NET MVC 3\Assemblies
    • %ProgramFiles%\ Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies
    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

vs2013 開啟vs2010 找不到此項目類型所基於的應用程式 MVC2 升級 MVC5 不能載入Web項目

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.