C# 編譯器錯誤C# Compiler Errors

部分 C# 編譯器錯誤會有對應的主題來說明產生錯誤的原因,以及在某些情況下,如何修正錯誤。Some C# compiler errors have corresponding topics that explain why the error is generated, and, in some cases, how to fix the error. 使用下列其中一個步驟,來查看說明是否適用於特定的錯誤訊息。Use one of the following steps to see whether help is available for a particular error message.

  • 輸出視窗中尋找錯誤代碼 (例如 CS0029),然後在 Microsoft Docs 上搜尋此代碼。Find the error number (for example, CS0029) in the Output Window, and then search for it on Microsoft Docs.

  • 輸出視窗中選擇錯誤代碼 (例如 CS0029),然後選擇 F1 鍵。Choose the error number (for example, CS0029) in the Output Window, and then choose the F1 key.

  • 在 [索引] 中的 [尋找] 方塊內輸入錯誤代碼。In the Index, enter the error number in the Look for box.

如果這些步驟都沒有產生關於錯誤的資訊,請移至本頁面的結尾,並傳送包含錯誤代碼或文字的意見反應。If none of these steps leads to information about your error, go to the end of this page, and send feedback that includes the number or text of the error.

如需如何在 C# 中設定錯誤和警告選項的相關資訊,請參閱專案設計工具、建置頁 (C#)For information about how to configure error and warning options in C#, see Build Page, Project Designer (C#).


在下列指示的某些 Visual Studio 使用者介面項目中,您的電腦可能會顯示不同的名稱或位置:Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. 您所擁有的 Visual Studio 版本以及使用的設定會決定這些項目。The Visual Studio edition that you have and the settings that you use determine these elements. 如需詳細資訊,請參閱將 Visual Studio IDE 個人化For more information, see Personalizing the IDE.

另請參閱See also