Im attempting to create a C# debugging visualizer that can perform a visualization on all objects. I cant seem to get the assembly attribute (above the namespace) to bind this visualizer to System.Object like Ive been able to with other objects in the system. I've searched at length but haven't found any examples/discussion about creating a visualizer for all objects. Here is the code Im trying to get working, it works well enough when bound to String or Int32, but not Object or object.

Being a former Java programmer that used IntelliJ Im used to being able to see in debug mode what the heap address is that a specific reference is pointing to. This allows you to see at a glance if two objects are reference equal. Also, there are a few other things that would be valuable to know, but they can be a bit lengthy to explain. If I can get it working Ill post the final code.

So does anyone know how to get a visualizer to be active for all objects?

网友答案:

I dont know what is wrong whit your code.
however @Bismark, the target does not have tobe serialize able as you can use your own VisualizerObjectSource to sesialize it

I do suggest you serailise the .GetType().AsseblyQualifierName along whit it, this will allow you to what kind of object the stream contains, so at deserialisation you know that you object is acutaly an instance of class x, I used this technique one of my own visualizers as sometimes you might be serialising an sub-type of of the class whilke at the deserialisation you have no idea what time you are working with.