Exception with WebConfigurationManager.AppSettings.Get("urlAddress")



I am very new to working with XML. I've been weeding my way through debugging a project that was handed to me, but have run into quite a wall.


My code:



XmlWriter xmlWriter = XmlWriter.Create("ToPost.xml");

xmlWriter.WriteStartDocument();
xmlWriter.WriteStartElement("eclRequest xmlns='" + WebConfigurationManager.AppSettings.Get("urlAddress") + "'");
.....


But the WebConfigurationManager.AppSettings.Get("urlAddress") is giving me the following Exception:



Invalid name character in 'eclRequest xmlns='''. The ' ' character, hexadecimal value 0x20, cannot be included in a name.



I was wondering what exactly this Get() statement is accessing, and what could be causing the Exception?


No comments:

Post a Comment