2014-02-13 21 views
15

我試圖構建我的項目,Visual Studio告訴我我的項目中有錯誤。錯誤窗口顯示它列出了「4個錯誤中的0個」。我在哪裏可以找到這些錯誤?Visual Studio「0 of 4 errors」

這是我剛剛創建了一個項目,所以唯一的C#代碼,我有如下:

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 

public partial class StationCreate : System.Web.UI.Page 
{ 
    protected void Page_Load(object sender, EventArgs e) 
    { 

    } 
} 

基本上是什麼都沒有。然後,我有這個文件,我從另一個複製的內容,我提出:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="StationCreate.aspx.cs" Inherits="StationCreate" %> 

<!DOCTYPE html> 

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
    <title></title> 
    <link href="styles.css" rel="stylesheet" type="text/css" /> 
    <style type="text/css"> 
     .auto-style1 { 
      width: 100%; 
     } 
     .auto-style2 { 
      width: 761px; 
     } 
     .auto-style3 { 
      font-size: large; 
     } 
     .auto-style7 { 
      width: 950px; 
     } 
    </style> 
</head> 
<body style="text-align: center"> 
    <form id="form1" runat="server"> 
    <div draggable="false" class="container"> 
    <table class="auto-style1"> 
      <tr> 
       <td style="text-align: left" class="header"> 

        <table class="auto-style1"> 
         <tr> 
          <td class="auto-style7"> 

     <asp:Label ID="TitleLabel" runat="server" Text="Station Creator" style="font-weight: 700; font-size:48pt; font-family:'Segoe UI'; text-transform:uppercase;"></asp:Label> 
           <br /> 
        <asp:Label ID="StationIDLabel" runat="server" style="text-transform:uppercase;"></asp:Label> 
          </td> 
          <td style="text-align: left"> 
    </td> 
         </tr> 
        </table> 
       </td> 
      </tr> 
     </table> 
     <br /> 

     <br /> 
     <br /> 
     <br /> 
     <br /> 
     <table class="auto-style1"> 
      <tr> 
       <td class="auto-style2"> 
        &nbsp;</td> 
       <td> 
        &nbsp;</td> 
      </tr> 
      <tr> 
       <td class="topTableCell"> 
     <asp:Label ID="StatusLabel" runat="server" style="font-weight: 700" Font-Size="Large" ForeColor="Black">Select a JOB</asp:Label> 
        <br /> 
        <br /> 
        <asp:TextBox ID="TextBox1" runat="server" CssClass="textbox"></asp:TextBox> 
       </td> 
       <td class="topTableCell"> 
        <span class="auto-style3">&nbsp;<br /> 
        </span> 
        <asp:Button ID="GenerateButton" runat="server" Text="Generate" OnClick="GenerateButton_Click" Enabled="False" CssClass="button" Font-Size="XX-Large" ForeColor="Gray" /> 
        <br /> 
        <br /> 
        <br /> 
        <asp:Button ID="DashboardButton" runat="server" CssClass="button" Font-Size="XX-Large" ForeColor="White" OnClick="DashboardButton_Click" Text="Dashboard" /> 
       </td> 
      </tr> 
     </table> 
     <br /> 

     <div class="gridViewContainer"> 
      </div> 
     <asp:Label ID="TestLabel" runat="server" Visible="False"></asp:Label> 


    </div> 
    </form> 
</body> 
</html> 
+2

您的解決方案中是否有多個項目?點擊其他項目,你可能會看到它們出現。 「X個Y錯誤」表示「總共Y個錯誤中當前項目中的X個錯誤」。 –

+0

我的解決方案中只有一個項目。我從另一個位置打開了另一個styles.css文件,但沒有保存它或任何東西,我做了一個新的styles.css – muttley91

+0

這可能只是一個清理解決方案的問題。選擇你的解決方案並轉到'Build' - >'Clean Solution'並嘗試再次構建。重新啓動VS也可能有所幫助。 –

回答

30

事實證明,我剛做了一個過濾器錯誤列表進行設置。一個愚蠢的錯誤,但經驗教訓!

編輯:

錯誤列表上的過濾選項可以通過點擊此按鈕可以找到:

fiter

這裏,沒有選擇。如果它被選中,您可以選擇根據錯誤在哪個項目中篩選錯誤消息/警告。通過取消選擇(如上圖所示),您將沒有過濾器,並且您應該看到所有錯誤。

+3

您能否包含一些關於如何檢查過濾器以及如何將其刪除的細節。它實際上會把這個問題變成一個很好的問題和答案。 –

+1

已編輯!查看上面的更改。 – muttley91

+2

Jeez。謝謝你,讓我瘋狂=) – Ted