Deserialize following Xml.??
-
Hi, I am getting this error There is an error in XML document (1, 2) When i Deserialize following Xml. <EnvironmentConfigurations> <EnvironmentConfiguration> <EnvironmentName>ABC</EnvironmentName> <CMSConfiguration> <Address>net.tcp://localhost:9000/Manager</Address> <Binding>netTcpBinding</Binding> <Contract>Common.Interfaces.Server</Contract> </CMSConfiguration> </EnvironmentConfiguration> <EnvironmentConfiguration> <EnvironmentName>XYZ</EnvironmentName> <CMSConfiguration> <Address>net.tcp://localhost:9000/Manager</Address> <Binding>netTcpBinding</Binding> <Contract>Common.Interfaces.Server</Contract> </CMSConfiguration> </EnvironmentConfiguration> </EnvironmentConfigurations>
-
Hi, I am getting this error There is an error in XML document (1, 2) When i Deserialize following Xml. <EnvironmentConfigurations> <EnvironmentConfiguration> <EnvironmentName>ABC</EnvironmentName> <CMSConfiguration> <Address>net.tcp://localhost:9000/Manager</Address> <Binding>netTcpBinding</Binding> <Contract>Common.Interfaces.Server</Contract> </CMSConfiguration> </EnvironmentConfiguration> <EnvironmentConfiguration> <EnvironmentName>XYZ</EnvironmentName> <CMSConfiguration> <Address>net.tcp://localhost:9000/Manager</Address> <Binding>netTcpBinding</Binding> <Contract>Common.Interfaces.Server</Contract> </CMSConfiguration> </EnvironmentConfiguration> </EnvironmentConfigurations>
-
Hi, I am getting this error There is an error in XML document (1, 2) When i Deserialize following Xml. <EnvironmentConfigurations> <EnvironmentConfiguration> <EnvironmentName>ABC</EnvironmentName> <CMSConfiguration> <Address>net.tcp://localhost:9000/Manager</Address> <Binding>netTcpBinding</Binding> <Contract>Common.Interfaces.Server</Contract> </CMSConfiguration> </EnvironmentConfiguration> <EnvironmentConfiguration> <EnvironmentName>XYZ</EnvironmentName> <CMSConfiguration> <Address>net.tcp://localhost:9000/Manager</Address> <Binding>netTcpBinding</Binding> <Contract>Common.Interfaces.Server</Contract> </CMSConfiguration> </EnvironmentConfiguration> </EnvironmentConfigurations>
The first line should be something like
<?xml version="1.0" encoding="utf-8" ?>
The second character of the first line must be a question mark, and that's the position shown in the error message. Obvioulsy, you've somehow lost your first line.