Generate C# class from XML

后端 未结 8 1722
青春惊慌失措
青春惊慌失措 2020-11-22 05:19

Can I generate a C# class from an XML file?

相关标签:
8条回答
  • 2020-11-22 05:48

    To convert XML into a C# Class:

    • Navigate to the Microsoft Visual Studio Marketplace: -- https://marketplace.visualstudio.com
    • In the search bar enter text: -- xml to class code tool
    • Download, install, and use the app

    Note: in the fullness of time, this app may be replaced, but chances are, there'll be another tool that does the same thing.

    0 讨论(0)
  • 2020-11-22 05:51

    If you are working on .NET 4.5 project in VS 2012 (or newer), you can just Special Paste your XML file as classes.

    1. Copy your XML file's content to clipboard
    2. In editor, select place where you want your classes to be pasted
    3. From the menu, select EDIT > Paste Special > Paste XML As Classes
    0 讨论(0)
提交回复
热议问题