私のアプリケーションでは、アプリケーション全体で使用するプロパティを含む Properties.cs ファイルを追加しました。NullReferenceException を取得しています =>Object reference not set to an instance of an object.
Properties.cs のコードは次のとおりです。
public class Properties
{
private static string type1;
public static string Type1
{
get
{
return type1;
}
set
{
type1= value;
}
}
}
そして、フォームの 1 つでこのプロパティにアクセスすると、エラーが発生します。例えば
if (Properties.Type1.Equals(string.Empty) || Properties.Type1.Equals(null))
{
// Do something
}