C#


ROSLYN.GLOBALIZATION.CA1304 : Specify CultureInfo (C#)

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

要旨

A method or constructor calls a member that has an overload that accepts a System.Globalization.CultureInfo parameter, and the method or constructor does not call the overload that takes the CultureInfo parameter. When a CultureInfo or System.IFormatProvider object is not supplied, the default value that is supplied by the overloaded member might not have the effect that you want in all locales. If the result will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'CultureInfo' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'.

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

プロパティ

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

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

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