Created
          September 1, 2022 12:56 
        
      - 
      
- 
        Save icodeintx/adefb11c3a277e5bb5e1baee2a29380d to your computer and use it in GitHub Desktop. 
    Xml To Json
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | string xmlContent = File.ReadAllText(@"c:\test\mismo.xml"); | |
| XmlDocument doc = new XmlDocument(); | |
| doc.LoadXml(xmlContent); | |
| string json = JsonConvert.SerializeXmlNode(doc); | |
| RootObject message = JsonConvert.DeserializeObject<RootObject>(json); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment