C#


ROSLYN.DESIGN.CA1044 : Properties should not be write only (C#)

See Roslyn-Detected C# Warning Classes for more information.

要旨

Although it is acceptable and often necessary to have a read-only property, the design guidelines prohibit the use of write-only properties. This is because letting a user set a value, and then preventing the user from viewing that value, does not provide any security. Also, without read access, the state of shared objects cannot be viewed, which limits their usefulness.

この指摘はRoslynのCA1044に該当します。ルール詳細につい ては、下記リンクを参照してください。 CA1044

プロパティ

クラス名 Properties should not be write only (C#)
日本語クラス名 Properties should not be write only (C#)
クラス分類 信頼性 (reliability)
ニーモニック ROSLYN.DESIGN.CA1044
カテゴリー なし
対応言語 C# で利用可能です。
有効/無効設定 このワーニングクラスのチェックはデフォルトで無効になっています。チェックを有効にするにはプロジェクト設定ファイル (configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += allow class="Properties should not be write only (C#)"

関連のある設定ファイルパラメータ

設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。