0

我在Visual Studio 2013中有一個MVC 4.5 C#項目。它運行完美無誤,直到一位同事開始和我一起工作。VS 2013 MVC 4.5破解引用

我的同事的VS版本是2015年,當他與我的項目同步(通過TFS)看起來像我所有的參考文獻被破壞。現在,VS不再識別我的Razor標籤,並給了我大量的錯誤和警告。

根據文件的數量,我打開錯誤和警告的列表變大。這是當我打開項目只是主視圖喜歡它的外觀的例子:

Warning 101 Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. 

Warning 103 Unknown element 'lmweb_mvc.models.leaseviewmodel' or element cannot be placed here. 

Error 104 The name 'model' does not exist in the current context 

Error 105 The name 'ViewBag' does not exist in the current context 

Error 106 The name 'ViewBag' does not exist in the current context 

Error 107 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition 
for 'BeginForm' and no extension method 'BeginForm' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a 
using directive or an assembly reference?) 

Error 108 The name 'FormMethod' does not exist in the current context 

Error 109 No overload for method 'DropDownList' takes 1 arguments 

Error 110 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'BeginForm' and no extension method 'BeginForm' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 111 The name 'FormMethod' does not exist in the current context 

Error 112 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'BeginForm' and no extension method 'BeginForm' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 113 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'ActionLink' and no extension method 'ActionLink' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 114 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'ActionLink' and no extension method 'ActionLink' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 115 The name 'ViewBag' does not exist in the current context 

Error 116 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'ActionLink' and no extension method 'ActionLink' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 117 The name 'ViewBag' does not exist in the current context 

Error 118 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'ActionLink' and no extension method 'ActionLink' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 119 The name 'ViewBag' does not exist in the current context 

Error 120 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'ActionLink' and no extension method 'ActionLink' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 121 The name 'ViewBag' does not exist in the current context 

Error 122 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'ActionLink' and no extension method 'ActionLink' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 123 The name 'ViewBag' does not exist in the current context 

Error 124 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'ActionLink' and no extension method 'ActionLink' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 125 The name 'ViewBag' does not exist in the current context 

Error 126 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'ActionLink' and no extension method 'ActionLink' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 127 The name 'ViewBag' does not exist in the current context 

Error 128 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'ActionLink' and no extension method 'ActionLink' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 129 The name 'ViewBag' does not exist in the current context 

Error 130 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'ActionLink' and no extension method 'ActionLink' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 
Error 131 The name 'ViewBag' does not exist in the current context 

Error 132 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition 
for 'DisplayFor' and no extension method 'DisplayFor' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 133 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'DisplayFor' and no extension method 'DisplayFor' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 134 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'DisplayFor' and no extension method 'DisplayFor' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 135 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'DisplayFor' and no extension method 'DisplayFor' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 136 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'DisplayFor' and no extension method 'DisplayFor' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 137 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'DisplayFor' and no extension method 'DisplayFor' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 138 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition 
for 'DisplayFor' and no extension method 'DisplayFor' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 139 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'DisplayFor' and no extension method 'DisplayFor' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 140 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'DisplayFor' and no extension method 'DisplayFor' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 141 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'ActionLink' and no extension method 'ActionLink' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 

Error 142 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'ActionLink' and no extension method 'ActionLink' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) 
+0

乳清你說'同步',你是什麼意思?您是否使用版本控制系統(例如Git,TFS)? – newmanth

+0

您是否嘗試過清潔解決方案?另外,你可以嘗試刪除你的.suo文件。 –

+0

@newmanth我的意思是TFS同步。是的,我正在使用版本控制,我試圖回滾,但它並沒有解決問題 –

回答

0

如果您使用的NuGet我建議你做一個

Update-Package –reinstall 

否則,你可以去看看參考路徑看看有什麼不對