2013-11-25 70 views
1

我有我的本地機器上創建的Sitefinity網站工作正常。但是,當我上傳到服務器,我得到這個錯誤:Sitefinity上傳到服務器錯誤:無法找到'System.Web.Razor

Could not load file or assembly 'System.Web.Razor, 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)

我在bin文件夾中Sytem.Web.Razor,並改變了綁定重定向較新的版本爲2.0.0,但後來我得到的錯誤下面。

Could not load file or assembly 'System.Web.Razor' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

+0

可能重複http://stackoverflow.com/questions/15874366/could-not-load-file-or-assembly-system-web-razor-or-one-its-dependencies) – Stefan

回答

0

我想你需要安裝MVC到你的網絡服務器。

退房:

Could not load file or assembly 'System.Web.Razor' or one of its dependencies

[未能加載文件或程序集 'System.Web.Razor' 或它的一個依賴](的
+0

感謝您的迴應。不幸的是,我沒有在GAC中安裝剃鬚刀dll的權限,我已經將dll設置爲複製到本地構建。無論如何,我只能在我的解決方案中做到這一點?當我首先發布它時,我也沒有得到這個錯誤,但問題是它不會加載我現有的頁面。 –

+0

嗯,這使得它更復雜。我認爲IIS將需要一些DLL與MVC正常工作。如果是這樣,我不確定你是否會運行,因爲IIS試圖編譯你的頁面。您可能會考慮部署預編譯版本。有關詳細信息,請參閱http://stackoverflow.com/questions/4608579/what-is-the-correct-way-to-precompile-an-asp-net-mvc-2-application。並確保您將項目中的所有參考設置爲「複製本地」。雖然我不確定它會不夠。 – Stefan

+0

我要求訪問GAC文件夾,我複製並替換我的項目中的System.Web.Razor和System.Web.Mvc dll,然後構建和發佈,並且完美地工作。非常感謝Stefan! –

相關問題