Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Class To Json
Class To Json

Class To Json

Marc Alfaro

|
232 installs
| (1) | Free
Convert your class model to JSON on the fly! Useful for quickly generating sample JSON strings or API request payloads from your models.
Download

This lightweight extension makes it effortless to convert your class symbols into JSON strings directly within Visual Studio. It’s especially useful when testing API endpoints, allowing you to quickly generate JSON payloads on the fly without leaving your IDE.

You can serialize your class models in two convenient ways:

✔️ A. By selecting and right-clicking your class in Solution Explorer and convert it instantly.

FromExplorer.gif

✔️ B. By placing your caret on a class symbol in the code editor and serialize it directly.

FromEditor.gif

In your code editor, you can choose to output the generated JSON string to your Clipboard, Notepad, or the IDE's document editor. You can even place the caret either on your type declaration or the variable name.

📌 Supports serializing ACTUAL values of class symbols during DEBUG mode

Class2jsondebug__1.gif

🕑 Save time and streamline your API testing by generating JSON payloads with just a click!

📣 Updates:

📍Version 1.2.3

  1. Fixed the infinite recursion when ToObject method blindly walks into every DataMembers, including self‑referencing structures and complex framework types like System.DateTime -when the debugger exposes DateTime as an object with dozens of internal members (Ticks, Calendar, etc.).
  2. Fixed circular referencing when Visual Studio debugger exposes synthetic members like “Raw View”, “Non-Public members”, etc.

📍Version 1.2

  1. Added support for serializing ACTUAL values of class symbols during DEBUG mode.

📍Version 1.1 walks up the inheritance chain and includes public properties from base types.

  1. Added support for full coverage of class members, including inherited ones and those from interfaces.
  2. Public properties from the class itself
  3. Public properties from all base classes
  4. Public properties from all implemented interfaces
  5. Deduplication to avoid name collisions
  6. Recursion protection and depth limit
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft