SA1642 : CSharp.Documentation : The documentation text within the constructor’s summary tag must begin with the text: Initializes a new instance of the class.

今天繼續嘗試把正在開始開發的Windows Phone 8 App的程式碼符合StyleCop的規定
當我使用StyleCop 檢查我的程式碼時出現了很多警告
E.G.

SA1642 : CSharp.Documentation : The documentation text within the constructor’s summary tag must begin with the text: Initializes a new instance of the class.

以下是我寫在Constructor上寫的Comment

/// <summary>
       /// <strong>This is the constructor of this class</strong>
       /// </summary>
        public MainPage()
        {
            InitializeComponent();

            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();
        }

誰不知..Style Cop 的規定是要在Constructor 上寫以以下的寫句開頭…
Initializes a new instance of the class.”

/// <summary>
        /// <strong>Initializes a new instance of the <see cref="</strong>MainPage<strong>" /> class</strong>
        /// and predefine variable settings and check ...etc
       /// </summary>
        public MainPage()
        {
            InitializeComponent();

            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();
        }

Happy Coding

Leave a Reply