VS 2012会在调试时抛出错误,但是对于MVC应用程序来说很好

时间:2016-07-26 20:33:17

标签: asp.net-mvc visual-studio-2012

当我尝试调试MVC应用程序但是构建工作正常并且应用程序在调试之外可用时,我遇到了大量错误。

我已经尝试过搜索修复程序,但我找不到任何工作。到目前为止,我已从TFS中删除并重新初始化了我的源代码。我的同事可以建立好。我假设我没有删除应删除的内容。

在尝试进行干净构建时,是否还应该清除其他位置?

以下是我的错误:

Error   22  'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'Action' and no extension method 'Action' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) Index.cshtml    145 
Error   81  'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'Action' and no extension method 'Action' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) Index.cshtml    145 7   http://localhost/MainSite/
Error   23  'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)   Index.cshtml    149 
Error   42  'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)   Index.cshtml    870 
Error   43  'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)   Index.cshtml    880 
Error   44  'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)   Index.cshtml    890 
Error   45  'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)   Index.cshtml    900 
Error   82  'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)   Index.cshtml    149 10  http://localhost/MainSite/
Error   101 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)   Index.cshtml    870 14  http://localhost/MainSite/
Error   102 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)   Index.cshtml    880 14  http://localhost/MainSite/
Error   103 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)   Index.cshtml    890 14  http://localhost/MainSite/
Error   104 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)   Index.cshtml    900 14  http://localhost/MainSite/
Error   30  A switch expression or case label must be a bool, char, string, integral, enum, or corresponding nullable type  Index.cshtml    404 
Error   31  A switch expression or case label must be a bool, char, string, integral, enum, or corresponding nullable type  Index.cshtml    489 
Error   32  A switch expression or case label must be a bool, char, string, integral, enum, or corresponding nullable type  Index.cshtml    555 
Error   40  A switch expression or case label must be a bool, char, string, integral, enum, or corresponding nullable type  Index.cshtml    765 
Error   89  A switch expression or case label must be a bool, char, string, integral, enum, or corresponding nullable type  Index.cshtml    404 31  http://localhost/MainSite/
Error   90  A switch expression or case label must be a bool, char, string, integral, enum, or corresponding nullable type  Index.cshtml    489 31  http://localhost/MainSite/
Error   91  A switch expression or case label must be a bool, char, string, integral, enum, or corresponding nullable type  Index.cshtml    555 13  http://localhost/MainSite/
Error   99  A switch expression or case label must be a bool, char, string, integral, enum, or corresponding nullable type  Index.cshtml    765 18  http://localhost/MainSite/
Error   54  Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type  Index.cshtml    1051    
Error   113 Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type  Index.cshtml    1051    88  http://localhost/MainSite/
Error   15  The name 'model' does not exist in the current context  Index.cshtml    6   
Error   74  The name 'model' does not exist in the current context  Index.cshtml    6   2   http://localhost/MainSite/
Error   27  The name 'MvcHtmlString' does not exist in the current context  Index.cshtml    205 
Error   86  The name 'MvcHtmlString' does not exist in the current context  Index.cshtml    205 42  http://localhost/MainSite/
Error   19  The name 'Url' does not exist in the current context    Index.cshtml    54  
Error   20  The name 'Url' does not exist in the current context    Index.cshtml    120 
Error   21  The name 'Url' does not exist in the current context    Index.cshtml    121 
Error   28  The name 'Url' does not exist in the current context    Index.cshtml    340 
Error   29  The name 'Url' does not exist in the current context    Index.cshtml    344 
Error   33  The name 'Url' does not exist in the current context    Index.cshtml    648 
Error   38  The name 'Url' does not exist in the current context    Index.cshtml    753 
Error   39  The name 'Url' does not exist in the current context    Index.cshtml    757 
Error   46  The name 'Url' does not exist in the current context    Index.cshtml    910 
Error   47  The name 'Url' does not exist in the current context    Index.cshtml    911 
Error   48  The name 'Url' does not exist in the current context    Index.cshtml    912 
Error   49  The name 'Url' does not exist in the current context    Index.cshtml    916 
Error   50  The name 'Url' does not exist in the current context    Index.cshtml    917 
Error   51  The name 'Url' does not exist in the current context    Index.cshtml    918 
Error   52  The name 'Url' does not exist in the current context    Index.cshtml    919 
Error   53  The name 'Url' does not exist in the current context    Index.cshtml    920 
Error   55  The name 'Url' does not exist in the current context    Index.cshtml    1347    
Error   56  The name 'Url' does not exist in the current context    Index.cshtml    1370    
Error   57  The name 'Url' does not exist in the current context    Index.cshtml    1399    
Error   78  The name 'Url' does not exist in the current context    Index.cshtml    54  15  http://localhost/MainSite/
Error   79  The name 'Url' does not exist in the current context    Index.cshtml    120 14  http://localhost/MainSite/
Error   80  The name 'Url' does not exist in the current context    Index.cshtml    121 14  http://localhost/MainSite/
Error   87  The name 'Url' does not exist in the current context    Index.cshtml    340 32  http://localhost/MainSite/
Error   88  The name 'Url' does not exist in the current context    Index.cshtml    344 32  http://localhost/MainSite/
Error   92  The name 'Url' does not exist in the current context    Index.cshtml    648 61  http://localhost/MainSite/
Error   97  The name 'Url' does not exist in the current context    Index.cshtml    753 20  http://localhost/MainSite/
Error   98  The name 'Url' does not exist in the current context    Index.cshtml    757 20  http://localhost/MainSite/
Error   105 The name 'Url' does not exist in the current context    Index.cshtml    910 15  http://localhost/MainSite/
Error   106 The name 'Url' does not exist in the current context    Index.cshtml    911 15  http://localhost/MainSite/
Error   107 The name 'Url' does not exist in the current context    Index.cshtml    912 15  http://localhost/MainSite/
Error   108 The name 'Url' does not exist in the current context    Index.cshtml    916 15  http://localhost/MainSite/
Error   109 The name 'Url' does not exist in the current context    Index.cshtml    917 15  http://localhost/MainSite/
Error   110 The name 'Url' does not exist in the current context    Index.cshtml    918 15  http://localhost/MainSite/
Error   111 The name 'Url' does not exist in the current context    Index.cshtml    919 15  http://localhost/MainSite/
Error   112 The name 'Url' does not exist in the current context    Index.cshtml    920 15  http://localhost/MainSite/
Error   114 The name 'Url' does not exist in the current context    Index.cshtml    1347    14  http://localhost/MainSite/
Error   115 The name 'Url' does not exist in the current context    Index.cshtml    1370    14  http://localhost/MainSite/
Error   116 The name 'Url' does not exist in the current context    Index.cshtml    1399    14  http://localhost/MainSite/
Error   16  The name 'ViewBag' does not exist in the current context    Index.cshtml    39  
Error   17  The name 'ViewBag' does not exist in the current context    Index.cshtml    43  
Error   18  The name 'ViewBag' does not exist in the current context    Index.cshtml    49  
Error   24  The name 'ViewBag' does not exist in the current context    Index.cshtml    152 
Error   25  The name 'ViewBag' does not exist in the current context    Index.cshtml    152 
Error   26  The name 'ViewBag' does not exist in the current context    Index.cshtml    167 
Error   34  The name 'ViewBag' does not exist in the current context    Index.cshtml    726 
Error   35  The name 'ViewBag' does not exist in the current context    Index.cshtml    726 
Error   36  The name 'ViewBag' does not exist in the current context    Index.cshtml    734 
Error   37  The name 'ViewBag' does not exist in the current context    Index.cshtml    735 
Error   41  The name 'ViewBag' does not exist in the current context    Index.cshtml    819 
Error   75  The name 'ViewBag' does not exist in the current context    Index.cshtml    39  26  http://localhost/MainSite/
Error   76  The name 'ViewBag' does not exist in the current context    Index.cshtml    43  24  http://localhost/MainSite/
Error   77  The name 'ViewBag' does not exist in the current context    Index.cshtml    49  18  http://localhost/MainSite/
Error   83  The name 'ViewBag' does not exist in the current context    Index.cshtml    152 23  http://localhost/MainSite/
Error   84  The name 'ViewBag' does not exist in the current context    Index.cshtml    152 65  http://localhost/MainSite/
Error   85  The name 'ViewBag' does not exist in the current context    Index.cshtml    167 133 http://localhost/MainSite/
Error   93  The name 'ViewBag' does not exist in the current context    Index.cshtml    726 23  http://localhost/MainSite/
Error   94  The name 'ViewBag' does not exist in the current context    Index.cshtml    726 65  http://localhost/MainSite/
Error   95  The name 'ViewBag' does not exist in the current context    Index.cshtml    734 154 http://localhost/MainSite/
Error   96  The name 'ViewBag' does not exist in the current context    Index.cshtml    735 16  http://localhost/MainSite/
Error   100 The name 'ViewBag' does not exist in the current context    Index.cshtml    819 130 http://localhost/MainSite/

0 个答案:

没有答案