Home » FAQ » ASP.NET » Error Handling » I get error message at runtime ‘Value null was found where an instance of an object was required’ when using Application state variables. why?
Application State variables must be initialized in C# before any operation is performed on them. For example.:
You need to assign value to Counter state variable before performing the case (int)Session[‘Counter’].
Platform BlazorASP.NETWinFormsWPF.NET MAUI
Question *
Answer (Optional)
Email (Optional)
Email address is only for further clarification on your FAQ request. It will not be used for any other purpose.
Please leave this field empty.
Share with