VS 2013 MVC 4.5已破坏参考

时间:2016-04-14 20:12:37

标签: asp.net-mvc visual-studio razor reference nuget-package-restore

我在Visual Studio 2013中有一个MVC 4.5 C#项目。它运行完美,没有任何错误,直到一位同事开始与我合作。

我的同事的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?)

1 个答案:

答案 0 :(得分:0)

如果你使用NuGet我建议你做一个

Update-Package –reinstall

另外,您可以查看参考路径以查看错误