Terms of use?
By using this project or its source code, for any purpose and in any shape or form, you grant your implicit agreement to all the following statements:
- You condemn Russia and its military aggression against Ukraine
- You recognize that Russia is an occupant that unlawfully invaded a sovereign state
- You support Ukraine's territorial integrity, including its claims over temporarily occupied territories of Crimea and Donbas
- You reject false narratives perpetuated by Russian state propaganda
To learn more about the war and how you can help, click here. Glory to Ukraine! πΊπ¦
Object Dumper is a Visual Studio extension for exporting live .NET objects during debugging into reusable C#, Visual Basic, JSON, XML, or YAML representations.
Instead of manually expanding a large object graph and copying debugger values one by one, pause at a breakpoint, select an expression in the Code or Immediate window, choose Dump As, and Object Dumper sends the generated result to a new document, the Object Dumper output pane, or the clipboard.
Object Dumper is also available for:
Inspired by ObjectExporter.
- C# object initialization code
- Visual Basic object initialization code
- JSON
- XML
- YAML
C# and Visual Basic output is powered by VarDump. See the VarDump documentation for supported formatting and traversal options.
Typical use cases include:
- creating unit-test fixtures from real runtime objects
- capturing complex DTOs or domain objects for bug reproduction
- generating C# or Visual Basic initialization code
- exporting debugger state to JSON or YAML
- inspecting large object graphs without manually expanding every debugger node
- comparing two runtime objects by dumping them into separate documents and using Visual Studio's file comparison tools
Use Dump To to choose where generated content is written:
- New Document
- Output Window β Object Dumper
- Clipboard
Serialization, traversal, formatting, and output behavior can be configured under Tools β Options β Object Dumper.
Install Object Dumper from the Visual Studio Marketplace.
After installation, restart Visual Studio if prompted.
- Start debugging your .NET application.
- Stop at a breakpoint.
- Select an expression in the Code window, or enter/select an expression in the Immediate window.
- Right-click and open Dump As.
- Choose C#, Visual Basic, JSON, XML, or YAML.
- The generated output is sent to the destination configured by Dump To.
Configure dump behavior under:
Tools β Options β Object Dumper
| Option | Default |
|---|---|
| Max Depth | 25 |
| Operation Timeout | 10 seconds |
| Dump To | New Document |
C# and Visual Basic settings correspond to VarDump options. Refer to the VarDump documentation for their behavior.
See the changelog for release details and migration guidance.
| IDE | Documentation |
|---|---|
| Visual Studio | This page |
| Visual Studio Code | VS Code README |
| JetBrains Rider | Rider README |
Visual Studio can be used to compare two dumped object documents:
- Enable Show Miscellaneous Files in Solution Explorer.
- Dump both objects to separate documents.
- In Visual Studio 17.7 or later, select both files under Miscellaneous Files, right-click, and use the built-in comparison command.
- On older versions, install a diff extension such as Heku.VsDiff.
Supported Visual Studio versions:
- Visual Studio 2019
- Visual Studio 2022
Supported project languages:
- C#
- F#
- Visual Basic
Supported serializer targets include:
- .NET Framework 4.5+
- .NET Standard 2.0+
- .NET Core 2.0+
- .NET 5+
Local debugging is currently required.
When debugging optimized code, external DLLs, or some NuGet package code, Visual Studio may report errors such as:
Cannot evaluate expression because the code of the current method is optimized
or:
error CS0103: The name 'YellowFlavor' does not exist in the current context
Use a Debug build when possible.
Alternatively enable:
Tools β Options β Debugging β General β Suppress JIT optimization on module load
See the Visual Studio documentation.
Remote debugging is not currently supported.
If generated documents contain encoding-related issues, enable:
Tools β Options β Environment β Documents β Save documents as Unicode when data cannot be saved in codepage
UWP does not support Assembly.LoadFrom, which prevents Object Dumper from injecting the serializer assembly automatically.
A workaround is to reference the .NET Standard 2.0 version of the Serialization library directly and preload it:
YellowFlavor.Serialization.ObjectSerializer.WarmUp();See the UWP sample.
When debugging an IIS-hosted ASP.NET MVC backend, the debugger process may require additional filesystem access.
Grant YourComputerName\IIS_IUSRS:
- Read/Write access to
%userprofile%\AppData\Local\Temp - Read access to
%userprofile%\AppData\Local\Microsoft\VisualStudio
Otherwise Object Dumper may fail with UnauthorizedAccessException.
See issue #90.
Object Dumper separates Visual Studio integration from its serializer layer:
-
Visual Studio extension layer: Provides commands, menus, options, output destinations, and debugger integration.
-
Debugger interaction: Evaluates the selected expression and loads the appropriate serializer into the debuggee.
-
Shared serialization layer: Uses framework-specific
YellowFlavor.Serialization.dllassemblies. -
Serialization libraries
- VarDump for C# and Visual Basic
- Json.NET for JSON and XML
- YamlDotNet for YAML
-
ILRepack: Bundles serializer dependencies into merged assemblies to reduce dependency conflicts with the debuggee.
Object Dumper does not collect personal data.
Debugger interaction and serialization happen locally as part of your Visual Studio debugging session.
| Library | Purpose | License |
|---|---|---|
| VarDump | C# and Visual Basic serialization | Apache-2.0 |
| Json.NET | JSON and XML serialization | MIT |
| YamlDotNet | YAML serialization | MIT |
| ILRepack | Serializer dependency merging | Apache-2.0 |
Contributions, bug reports, and feature requests are welcome.
If Object Dumper saves you time, you can support its continued development through:
Object Dumper is licensed under the MIT License.



