App.config hexadecimal values and quotes

Posted on 2006-05-26
Last Modified: 2006-11-18
Is it possible and how to place hexadecimal numbers in a string in the config file and or strings with a " in it?

   <add key="Colors" value="&H0, &HA0, &HA000, &HA0A0, &HA000A0, &HA0A000, &HA0A0A0"/>
   <add key="SomeString" value="Some string with " and maybe also ' and other weird characters"/>

The standard VB or XML methods don't work I noticed.

&#xxx does not work for special characters.
Adding a \ or another & in front also doesn't help.
I get "expected ;" as soon as I use & in this file.

Visual Studio 2005 with .NET 2.0
Question by:NicoLaan
    LVL 5

    Accepted Solution

    app.config while is xml, limits special characters for security purposes.  You will need to create your own inner xml with in the config file rather then using the built in Key Value Pair operations.  You will then simply create your own template for how multiple peices of data are broken up.


             <color hex="H0" />
             <color hex="HA0" />

    As for special characters, if you are trying to import text statements or "copy" use your webconfig to point at the file or database that these phrases are stored rather then storing them in the app.config
    LVL 4

    Author Comment

    I see, so actually it's not possible just with a workaround.
    Thanks for the clear answer.

    I'll wait for a week to see if someone disagrees, if not, the points are yours.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    It’s quite interesting for me as I worked with Excel using for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now