共用方式為


編譯器警告 (層級 1) CS1570

更新:2007 年 11 月

錯誤訊息

'construct' 上的 XML 註解格式錯誤 -- 'reason'

使用 /doc 時,原始程式碼中的任何註解都必須為 XML 格式。任何 XML 標記的錯誤都會產生 CS1570。例如:

  • 如果您要傳遞字串給 cref (例如以 <exception> 標記方式),該字串便必須括在雙引號中。

  • 如果您要使用沒有結尾標記的標記 (例如 <seealso>),您必須在結尾角括弧前指定正斜線。

  • 如果您必須在說明文字中使用大於或小於符號,便需要以 &gt;&lt; 來表示它們。

  • <include> 標記上的檔案或路徑屬性遺失或格式不正確。

下列範例會產生 CS1570:

// CS1570.cs
// compile with: /W:1
namespace ns
{
   // the following line generates CS1570
   /// <summary> returns true if < 5 </summary>
   // try this instead
   // /// <summary> returns true if &lt;5 </summary>

   public class MyClass
   {
      public static void Main ()
      {
      }
   }
}