Reputation: 2748
This setting is not allowed in App.Config due to the error The element app settings has invalid element 'BscSerialNumber'. List of possible elements expected 'add,remove,clear'
<add key="PreValue" value="<BscSerialNumber>"/>
The value <BscSerialNumber>
is an actual string that i want in my setting.
Upvotes: 0
Views: 372
Reputation: 1495
You need to escape the angle-brackets. Use <
instead of <
and >
instead of >
.
The appsetting entry should end up looking like this:
<add key="PreValue" value="<BscSerialNumber>"/>
When you read the setting in code, it will contain the string, including the angle-brackets:
Upvotes: 3