Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Missing field with mmAppConfiguration
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Missing field with mmAppConfiguration
Miscellaneous
Thread ID:
01057342
Message ID:
01057342
Views:
51
I have subclassed the mmAppConfiguration class and set the class to use a different file name in the constructor method. If my class properties and config file keys match, everything works fine, but I am getting the error:

"Object reference not set to an instance of an object"

when a key is missing. Maybe I misread the documentation, but I thought this class would write out any missing keys? The section of code that is throwing the exception is in the WriteKeysToConfig() method which is being called by the ReadKeysFromConfig() method because there are missing keys. Below is the code:

// *** If we can't find the key - write it out to the document
string Value = null;
if (Field.MemberType == MemberTypes.Field)
Value = ((FieldInfo) Field).GetValue(this).ToString();

Thanks in advance for your help.

Kind Regards,

Mat
Matthew Kennedy
Decision Support Technology Inc.

"I try to take one day at a time, but sometimes several days attack me all at once." ~ Ashleigh Brilliant

New Jersey Dot Net User Group
Reply
Map
View

Click here to load this message in the networking platform