Receiving Invalid Character message from web.config file when app loads

Posted on 2008-11-19
Last Modified: 2012-05-05
Ok, I added a new page to an existing application running on a dev server.   There is a string of special characters I added as one of the appsetting values in the web.config.  The new page reads this string and performs a function to dycrypt it to a password which it needed for other functionality.   Everything is working great in DEV.  
Today we moved the page and the web.config settings to QA.  Now there is a problem.  The app wont even load.  Getting a messsage 'There is an invalid character in the given encoding line 31 position 34.   This is the first special character in the new appsetting value.   I verified that the header of the web.config in both DEV and QA match:   <?xml version="1.0" encoding="utf-8"?>.  I also verified the special characters are the exact same on both servers.
So why would the special characters load ok on one server and not the other?  
Question by:smolakm
    1 Comment

    Accepted Solution

    THis has been resolved with a bit more investgation.   The web.config on the QA was edited with Notepad and when saved, saved in ANSI format.    I opened the web condif and did a Save As with the UTF-8 format....fixed the problem.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    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…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    729 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

    15 Experts available now in Live!

    Get 1:1 Help Now