2010-06-25 193 views
1

我試圖將我的新ASP.NET MVC 2.0網站部署到我們的Windows Server 2008框,並有一些問題。部署ASP.NET MVC2應用程序問題

我在IIS中創建了一個新網站,確保應用程序池已設置爲「集成」。當我瀏覽到網站時,出現以下錯誤。

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複製本地,但沒有影響。 在我的倉的DLL是:

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

如果它的事項該網站是非常簡單的。在MVC應用程序的默認登錄和註冊之外,沒有真正的邏輯。它的真正意義。

回答

2

有沒有機會從MVC 1.0版升級?你可能想檢查dll本身的版本號。

在服務器上運行MVC安裝程序也可能有幫助。

+0

安裝MVC的工作,我不能相信我忘了這樣做。杜爾。 謝謝! – 2010-06-25 20:05:48

1

您不需要在服務器上安裝MVC2以運行它。

System.Web.Mvc.dll程序

System.ComponentModel.DataAnnotations.dll如果您正在運行.NET Framework 3.5:您可以通過設置屬性本地副本這些引用的真正做斌部署而不是.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/

+0

不錯的帖子Arturito。非常有幫助,能夠跟隨。 – Shawn 2011-05-22 02:06:49