Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Specifying a Custom Configuration Class
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Specifying a Custom Configuration Class
Miscellaneous
Thread ID:
01156194
Message ID:
01156194
Views:
86
In the MM Dev Guide, there is a section called "Application Settings Classes" under the "Overview of Mere Mortals .NET" section. There it explains "Specifying a Custom Configuration File". I have followed the instructions, but I can not get it to work properly.

1. I created a subclass of mmAppConfiguration called myAppConfig

2. In the constructor, I added the line

this.ReadKeysFromConfig("c:\\myFolder\\dst.config");

3. I want to do this Strongly Typed, so I added public fields to the class myAppConfig. For instance:

[DefaultValue("123"),
Description("SerialNumber"]
public string SerialNumber
{
get (return this._serialNumber; )
set
{
this._serialNumber = value;
}
}
private string _serialNumber = "123";

4. In the dst.config XML file, I have a section for with the line:

add key="SerialNumber" value="9876543210"

Whenever I run, I always get the default value "123". I have tried stepping through the Framework code, but I can't see why it is not reading the setting from my file?

Any help is appreciated.

Kind Reagrds,

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