部署ASP.NET MVC2应用程序问题

时间:2010-06-25 19:18:45

标签: .net asp.net-mvc

我正在尝试将我的新ASP.NET MVC 2.0网站部署到我们的Windows Server 2008框中并遇到一些问题。

我在IIS中创建了一个新网站,确保将应用程序池设置为Integrated。当我浏览网站时,我收到以下错误。

Server Error in '/' Application.

Configuration Error 
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Source Error: 


Line 17:         validateRequest="false"
Line 18:         pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
Line 19:         pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
Line 20:         userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
Line 21:       <controls>

第19行是违规行。我尝试使用谷歌搜索,但我找不到与MVC相关的问题,只是其他应用程序。

我尝试将MVC相关的DLL设置为本地复制,但这没有任何影响。 我的bin中的DLL是:

System.Web.Abstractions.dll
System.Web.Mvc.dll
System.Web.Routing.dll
MyWebsite.dll

如果重要,网站很简单。除了MVC应用程序附带的默认登录和注册之外,它还没有真正的逻辑。它的观点真的很棒。

2 个答案:

答案 0 :(得分:2)

您是否有机会从MVC 1.0升级?您可能想检查dll本身的版本#。

在服务器上运行MVC安装程序也可能有所帮助。

答案 1 :(得分:1)

您无需在服务器上安装MVC2即可运行它。您可以通过将属性Copy Local设置为true来执行Bin Deployment:

System.ComponentModel.DataAnnotations.dll

System.Web.Mvc.dll程序

如果您运行的是.NET Framework 3.5 NOT .NET Framework 3.5 SP1 改变所有这些的属性。

System.ComponentModel.DataAnnotations.dll

System.Web.Abstractions.dll

System.Web.Mvc.dll程序

System.Web.Routing.dll

无论如何,我写了一步一步的教程如何配置服务器和部署MVC2应用程序

http://arturito.net/2011/01/21/publishing-asp-net-mvc2-application-on-windows-server-2008-iis-7-with-visual-studio-2008-on-platform-net-3-5-sp1/