Reflection-based Visual Studio and Visual Studio Code extension for exporting in-memory objects during debugging to C# Object Initialization Code, JSON, Visual Basic Object Initialization Code, XML, and YAML string.
Inspired by ObjectExporter.
The closest alternative is proprietary OzCode export functionality.
"Dump as" commands are available via context menu in the Code and Immediate windows.
The result will be printed to a new document window, Output Window -> Object Dumper Pane, or copied to the clipboard, depending on the DumpTo option.
- How to compare two dumped objects:
- Enable option "Show Miscellaneous files in Solution Explorer":
- If you use Visual Studio 17.7 or above - just skip this step (it's an embedded), otherwise install a diff extension - I verified the Heku.VsDiff
- Select files in Solution Explorer under the Miscellaneous Files folder -> Right click -> Compare Selected(Files):
- C#, F# and VisualBasic project languages are currently supported only.
- netstandard 2.0+, netcore2.0+, netframework 4.5+
- if you are debugging the solution in Release mode or debuging DLLs from another source, such as a nuget package, you'll get an error message: "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". Solution: switch to Debug mode or turn the Tools > Options > Debugging > General > Suppress JIT optimization on module load option on.
- local debugging only.
- if you see any encoding-related issues, please select the option: Tools > Options > Environment > Documents > Save documents as Unicode when data cannot be saved in codepage.
- it doesn't work for UWP applications, because UAP doesn't support Assembly.LoadFrom. You can bypass this restriction by referencing the .nestandard20 version of Serialization lib and calling:
YellowFlavor.Serialization.ObjectSerializer.WarmUp();
for loading the serializer into executing assembly. Example
Privacy Notice: No personal data is collected at all.
Repository | License |
---|---|
ILRepack | |
Json.NET | |
VarDump | |
YamlDotNet |
- ⭐ Star this repo on GitHub.
- ✏️ Write a review and star this extension on Visual Studio Marketplace or Visual Studio Code Marketplace.
- 🐞 Open an issue or browse more such issues to contribute to on GitHub.
- 🔗 Share with your friends.
- 🍪 Sponsor me on GitHub or PayPal.