私はこれに遅れていることを知っていますが、ここに行きます。
これらの警告はすべて、InitializeComponent
メソッド内のコードに対して発行されていると思いますか?もしそうなら、Common7 \ IDE \ ItemTemplatesフォルダーにあるテンプレートファイルを変更することを検討しましたか?GeneratedCode
それらのメソッドに属性を追加できます。属性はその属性にのみ設定されるため、同じクラス内の他のすべてのコードは引き続きコード分析によってチェックされます。
Form
デザイナファイルの例を次に示します。
namespace $rootnamespace$
{
partial class $safeitemrootname$
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("Windows Form Designer generated code", "1.0.0.0"), System.Diagnostics.DebuggerNonUserCode()]
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Text = "$safeitemrootname$";
}
#endregion
}
}