locked
Web.Config configuration error

    Question

  • Hi,

    Created web application and hosted on test server. When running the application getting the error: as below

    Configuration Error

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: Invalid character in the given encoding. Line 34, position 32.

    Source Error:
    Line 32:     <!--PortNumber 0 for local or test and 587 for Live. if you dont need port number then set 0-->
    Line 33:        
    Line 34:     <add key="Currency" value="�"/>
    Line 35:     <add key="CurrencyCode" value="GBP"/>
    Line 36:     <add key="OrderPath" value="D:\Inetpub\wwwroot\CSCS\OrderXML\"/>

    Source File: D:\Inetpub\wwwroot\CSCS\web.config    Line: 34


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

    The Currency symbol is showing wrong. We put the currency GBP  and symbol "£"

    Please if any one can help.

    Thanks in advance.

    Monday, April 30, 2012 7:53 AM

All replies

  • First, if you are using C# any strings with special character you need to put @ at the beginning of the string.  the "£" is a unicode which is 16 bits instead of sascii which is 8 bits.

    string filename = @"c:\temp\abc.txt";

    The html header may be set to the wrong country or the website may not except the header you are using.

    An example of the header would look like this.  the onebelow is showing just the language but there are country codes as well.

    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

    How are you making your connection and what data are you sending?


    jdweng

    Monday, April 30, 2012 4:40 PM