C#


ROSLYN.GLOBALIZATION.CA1305 : Specify IFormatProvider (C#)

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

要旨

A method or constructor calls one or more members that have overloads that accept a System.IFormatProvider parameter, and the method or constructor does not call the overload that takes the IFormatProvider parameter. When a System.Globalization.CultureInfo or 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 based on the input from/output displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider'. Otherwise, if the result will be stored and accessed by software, such as when it is loaded from disk/database and when it is persisted to disk/database, specify 'CultureInfo.InvariantCulture'.

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

プロパティ

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

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

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