Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Deserialize following Xml.??

Deserialize following Xml.??

Scheduled Pinned Locked Moved C#
wpfwcfsysadminxmlhelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ashishtango
    wrote on last edited by
    #1

    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>

    M B 2 Replies Last reply
    0
    • A ashishtango

      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>

      M Offline
      M Offline
      Mirko1980
      wrote on last edited by
      #2

      The exception you are receiving has an InnerException property, it should tell you what the problem is.

      1 Reply Last reply
      0
      • A ashishtango

        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>

        B Offline
        B Offline
        Bernhard Hiller
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups