2016-02-12 30 views
0

當我在Visual Studio中啓動ASP.NET MVC項目,我得到這個錯誤:文件未發現異常的MVC項目的引用

File not found exception wasn't handled in the user code An exception of type 'System.IO.FileNotFoundException' occurred in
System.Web.Mvc.dll but was not handled in user code

Additional information: Could not load file or assembly 'System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

+2

檢查如果System.Web.Razor存在於你的'References'文件夾中,並且它存在,檢查版本是否爲'2.0.0.0' –

+0

非常感謝! – Svetoslav

+0

它存在。仍然錯誤。 – AgentFire

回答

0

更新:

,因爲它似乎,@ alorika的答案是正確的(缺少參考System.Web.Razor

老答案:

您正在使用哪個版本的Visual Studio?哪個版本的MVC?我會首先嚐試修復安裝。只需進入控制面板 - >安裝程序 - >選擇VS並點擊更改/修復。

在打開的窗口中,選擇修復並讓程序運行。 VS repair

如果這沒有幫助,再次去所有程序,再次選擇VS,然後點擊修復。但是這一次,在VS窗口,打開選擇修改並確認,「微軟Web開發工具」被選中(如果沒有,請選中它並點擊「更新」):

VS modify

+0

不起作用... – AgentFire

+0

你試圖做什麼來解決問題@AgentFire –