Shortly after I wrote this post I realized how to solve this problem without trying to resort to anything crazy like named pipes or writing files to disk (which didn’t work anyways). To see how I overcame this problem, check out this post.
I have been working feverishly on Woodstock, my debugger visualizer for WPF. The one fundamental problem I have is the fact that Visual Studio has a timeout for the function which does the heavy lifting of processing every element in the visual tree. Since that function can take a long time to complete, Woodstock can become unusable on a very slow machine or an app with a gigantic visual tree because VS keeps reporting “Function evaluation timed out.” In fact, my new machine running Vista Pro at work is so horribly slow and clunky that Woodstock almost always times out. Oddly enough, my old XP machine at home almost never times out… (thanks for the killer new OS, Microsoft!)
The method which has a timeout applied to it is my ElementTreeVisualizerObjectSource.GetData(). I think the timeout is there for deadlock detection, but I’m not sure. Regardless, I need to figure out a way to have the visualizer (which lives in the debugger’s process) and the ElementTreeVisualizerObjectSource (which lives in the process of the code being debugged) communicate outside of using GetData(). That way the method calls won’t be subject to a timeout. I tried opening a WCF service in GetData(), assuming that I could somehow have the two processes communicate via named pipes, but my complete ignorance of WCF made it impossible.
I also tried spawning a worker thread in GetData() which wrote the visual tree data out to a file, which the visualizer would then read in and deserialize, but for some reason the worker thread never started executing. I have no idea why.
So, I’m raising my arms with complete humility and humbly asking the world at large to help me figure this out. If you know of a way to do this, please let me know. I’m thinking that there must be a way to use a named pipe with WCF here, but I could be way off. If I am, what’s the problem?
Any useful advice will be most appreciated.