7

是Visual Studio 2010的兼容MVC 1.0ASP.Net MVC 1.0在Visual Studio 2010


好傢伙,

感謝提前閱讀。

我正在使用MVC 1.0項目和VS2008。

我會很高興地升級到VS2010,但我懷疑有關它與MVC 1.0的兼容性。

你做到了嗎?它是如何產生的?

回答

2

的Visual Studio 2010將帶着ASP.NET MVC 2.0開箱,所以最好的辦法是現有的1.0項目轉換爲2.0。

你的ASP.NET MVC 1.0項目應該是(幾乎)與ASP.NET MVC 2.0完全兼容(有輕微的重大更改少數)。將項目轉換爲ASP.NET MVC 2.0所需的全部內容都是項目文件中的GUID更改。

約兼容性和轉換的詳細信息,請參見ASP.NET MVC 2.0 Release Notes

+3

他問的是VS2010是否與MVC1兼容,而不是MVC2是否與其兼容。 – anthares 2010-02-09 20:48:39

+0

非常感謝羅伯特 我現在可以安靜地睡覺了...... P – SDReyes 2010-02-09 20:49:15

+0

謝謝Anthares! 再次感謝你羅伯特。 :) – SDReyes 2010-02-09 20:57:13

4

一切似乎都很好。我能夠得到它的工作,雖然它採取了一點點黑客攻擊。

  1. 使用this tool將MVC 1.0解決方案轉換爲MVC 2.0。
  2. 在VS 2010中打開升級後的解決方案。
  3. 刪除對MVC 2.0的引用,並添加對希望保存的1.0版System.Web.Mvc.dll的引用。確保將此1.0引用的「Copy Local」屬性標記爲true。
  4. 經過[MVC項目根] \ Web.config文件和[MVC項目根] \查看\ Web.config文件中和更改版本2.0.0到1.0.0的任何地方,你看到System.Web.Mvc參考。
+0

我得到了它的工作,但沒有知道/ View文件夾中的web.config有一個對MVC的引用,非常感謝@ZaChickster – VinnyG 2011-03-21 21:09:32

0
<pages validateRequest="false" pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> 
    <controls> 
    <add assembly="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" namespace="System.Web.Mvc" tagPrefix="mvc" /> 
    </controls> 
</pages> 

我已經更換,以System.Web.MVC,版本2.0.0.0的引用與1.0.0.0,但 我正在查看沒有發現,因爲System.Web.Mvc.ViewTypeParserFilter和系統錯誤。 Web.Mvc.ViewPage在web.config中使用Verision 2.0.0.0。

相關問題