The issue is that Visual Studio itself, the IDE, runs as a 32-bit process only. If it is to run a custom data visualizer for you while debugging, the custom visualizer and all the code that this visualizer loads must be loadable and runnable by a 32-bit process. The custom visualizer gets the object to visualize by a serialization/deserialization process. To deserialize the object, the visualizer must be able to load the .dll in which the object is defined. And here we run in to the snag: if we are building our application to an x64 target (rather than an AnyCpu target), we’re up a creek – it doesn’t matter if the custom visualizer itself is built to a 32-bit target, because it’s the application code that must be used for deserialization.
So if your application is built to a 64-bit target, you cannot run a custom visualizer (big, big OUCH Microsoft!). To get around the snag, you can build to a target of AnyCpu, and then things work well: the application loads and runs as 64-bit (since targeted to AnyCpu), but the IDE is still able to load the .dll’s as 32-bit for the purposes of the custom data visualizer running in the IDE’s process space.
If I am wrong on this and there is a better work-around, I would love to be corrected! Thanks.