Paste XML as Class

Generate POCOs from XML or JSON

Visual Studio has a neat little trick to generate POCO’s from XML or JSON. VS allows you to paste XML or JSON as classes.

  1. Open your XML or JSON file in your favorite text editor.
  2. Copy the XML or JSON data to your clipboard.
  3. Create a new class file in your Visual Studio project.
  4. From within Visual Studio, select Edit -> Paste Special -> Paste [XML or JSON] as Classes

You now have simple POCO’s without having to create them by hand. Enjoy.

Paste XML as Class

One comment

Leave a Reply