將Asp.Net下的Mvc1升級到Mvc2簡單方法

來源:互聯網
上載者:User

1. 找到MVC 1.0的項目工程檔案,即以.csproj為副檔名的那個檔案,用記事本或者其它文字編輯器(如:UltraEdit)開啟它,找到ProjectTypeGuid節點元素,如:

<ProjectTypeGuids>{603c0e0b-db56-11dc-be95-000d561079b0};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>

將GUID {603c0e0b-db56-11dc-be95-000d561079b0}替換成{F85E285D-A4E0-4152-9332-AB1D724D3325}後儲存。

2. 開啟項目的Web.Config檔案,將所有的System.Web.Mvc, Version=1.0.0.0替換成System.Web.Mvc, Version=2.0.0.0後儲存。

3. 在Web.Config檔案的Configuration節點下添加新的元素,如下:

<runtime>
 <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
   <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
   <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/>
  </dependentAssembly>
 </assemblyBinding>
</runtime>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.