开发者

ASP.Net MVC 1.0 in Visual Studio 2010

Is Visual Studio 2010 compatible with MVC 1.0


Hello guys,

Thanks for reading in advance.

I'm working with a MVC 1.0 project and VS2008.

I will be very glad to upgrade to VS20开发者_运维知识库10, but I'm doubting about its compatibility with MVC 1.0.

Have you done it? How did it result?


Everything seemed to be fine. I was able to get it to work, though it took a little bit of hacking.

  1. Convert the MVC 1.0 solution to MVC 2.0 using this tool.
  2. Open the upgraded solution in VS 2010.
  3. Remove the reference to MVC 2.0 and add a reference to the 1.0 version of System.Web.Mvc.dll you hopefully saved. Make sure to flag the "Copy Local" property of this 1.0 reference to true.
  4. Go through the [mvc project root]\Web.config and [mvc project root]\Views\Web.config files and change the version 2.0.0 to 1.0.0 anyplace you see a reference to System.Web.Mvc.


Visual Studio 2010 will come with ASP.NET MVC 2.0 out of the box, so your best bet is converting your existing 1.0 project to 2.0.

Your ASP.NET MVC 1.0 project should be (almost) fully compatible with ASP.NET MVC 2.0 (there are a small number of minor breaking changes). All that is required for converting the project to ASP.NET MVC 2.0 is a GUID change in the project file.

See the ASP.NET MVC 2.0 Release Notes for more information about compatibility and conversion.


<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>

I had replaced references to System.Web.MVC, Version 2.0.0.0 with 1.0.0.0, but I was getting View not found errors because the System.Web.Mvc.ViewTypeParserFilter and System.Web.Mvc.ViewPage were using Verision 2.0.0.0 in web.config.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜