views:

136

answers:

1

hi,

i installed the mono develop and mono 2.6 on windows, when i compile the app im getting this exception. can any on help me to solve the issue, Registering application:

Host:          any

Port:          any

Virtual path:  /

Physical path: C:\Documents and Settings\sameer\My Documents\Projects\testMonoWeb\testMonoWeb\

pp11:Mono.WebServer.XSPApplicationHost

Exception caught during reading the configuration file:

System.Configuration.ConfigurationErrorsException: There is no Unicode byte order mark. Cannot switch to Unicode. (C:\Documents and Settings\sameer\My Documents\Projects\testMonoWeb\testMonoWeb\web.config) ---> System.Xml.XmlException: There is no Unicode byte order mark. Cannot switch to Unicode.

at System.Xml.XmlTextReaderImpl.Throw(Exception e)

at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)

at System.Xml.XmlTextReaderImpl.CheckEncoding(String newEncodingName)

at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)

at System.Xml.XmlTextReaderImpl.Read()

at System.Xml.XmlTextReader.Read()

at System.Configuration.XmlUtil..ctor(Stream stream, String name, Boolean readToFirstElement, ConfigurationSchemaErrors schemaErrors)

at System.Configuration.BaseConfigurationRecord.InitConfigFromFile()

--- End of inner exception stack trace ---

at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)

at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)

at System.Configuration.BaseConfigurationRecord.GetSection(String configKey, Boolean getLkg, Boolean checkPermission)

at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)

at System.Web.Configuration.HttpConfigurationSystem.GetApplicationSection(String sectionName)

at System.Web.Configuration.HttpConfigurationSystem.GetSection(String sectionName)

at System.Web.Configuration.HttpConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String configKey)

at System.Configuration.ConfigurationManager.GetSection(String sectionName)

at System.Configuration.ConfigurationManager.get_AppSettings()

at Mono.WebServer.XSP.Server.ApplicationSettings..ctor()

The value given for the address is not valid: 127.0.0.1

+2  A: 

Sounds like your web.config file is not saved with the correct encoding.

Try opening it in Notepad, and save as UTF8.

side noe: I'd advise you download notepad2.exe if you still don't have it - it is a very capable notepad.exe replacement, and one of its perks is with the ease of handling different encodings of the text file.

Ken Egozi
ok i will download the notepad2.exe thnkz for inputs.i changed the value encoding attribute from "UTF-16" to "UTF-8" i.e. <?xml version="1.0" encoding="utf-16"?> to <?xml version="1.0" encoding="utf-8"?> this issue is now resolved ,
sameer