Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Missing field with mmAppConfiguration
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Missing field with mmAppConfiguration
Divers
Thread ID:
01057342
Message ID:
01057342
Vues:
52
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
Répondre
Fil
Voir

Click here to load this message in the networking platform