<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cory Plotts' Blog &#187; Utilities</title>
	<atom:link href="http://www.cplotts.com/category/utilities/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cplotts.com</link>
	<description>Yet another UX guy, working in WPF/Silverlight.</description>
	<lastBuildDate>Tue, 15 Nov 2011 21:22:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Snoop Tips &amp; Tricks #2: Snooping Transient Visuals</title>
		<link>http://www.cplotts.com/2011/02/14/snoop-tips-tricks-2-snooping-transient-visuals/</link>
		<comments>http://www.cplotts.com/2011/02/14/snoop-tips-tricks-2-snooping-transient-visuals/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 06:01:11 +0000</pubDate>
		<dc:creator>cplotts</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Snoop]]></category>
		<category><![CDATA[TipsAndTricks]]></category>

		<guid isPermaLink="false">http://www.cplotts.com/2011/02/14/snoop-tips-tricks-2-snooping-transient-visuals/</guid>
		<description><![CDATA[In this trick, I show you how useful the prior one can really be. That is, it can be used to Snoop transient visuals … or visuals that aren’t currently in the visual tree. A perfect example of this type of visual … are combo box items. Snoop Tips &#038; Tricks #2: Snooping Transient Visuals [...]]]></description>
			<content:encoded><![CDATA[<p>In this trick, I show you how useful the prior <a href="http://www.cplotts.com/2011/02/10/snoop-tips-tricks-1-ctrl-shift-mouse-over/">one</a> can really be.</p>
<p>That is, it can be used to Snoop transient visuals … or visuals that aren’t currently in the visual tree. A perfect example of this type of visual … are combo box items.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:65b494cb-773b-422b-80f8-2000dede2aa0" class="wlWriterEditableSmartContent">
<div><object width="448" height="252"><param name="movie" value="http://www.youtube.com/v/98UEVCQHmVA?hl=en&amp;hd=1"></param><embed src="http://www.youtube.com/v/98UEVCQHmVA?hl=en&amp;hd=1" type="application/x-shockwave-flash" width="448" height="252"></embed></object></div>
<div style="width:448px;clear:both;font-size:.8em">Snoop Tips &#038; Tricks #2: Snooping Transient Visuals</div>
</div>
<p>One thing I forgot to mention in the video … check out the root of the visual tree after I have used the Ctrl-Shift Mouse Over trick on the combo box item … it is not an App object … but a PopupRoot object. This is further indication that Snoop has refreshed the visual tree and placed the transient visual there in place of the normal App object.</p>
<p>Happy Snooping!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.cplotts.com%2F2011%2F02%2F14%2Fsnoop-tips-tricks-2-snooping-transient-visuals%2F&amp;title=Snoop%20Tips%20%26amp%3B%20Tricks%20%232%3A%20Snooping%20Transient%20Visuals" id="wpa2a_2">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.cplotts.com/2011/02/14/snoop-tips-tricks-2-snooping-transient-visuals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snoop Tips &amp; Tricks #1: Ctrl-Shift Mouse Over</title>
		<link>http://www.cplotts.com/2011/02/10/snoop-tips-tricks-1-ctrl-shift-mouse-over/</link>
		<comments>http://www.cplotts.com/2011/02/10/snoop-tips-tricks-1-ctrl-shift-mouse-over/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 05:59:30 +0000</pubDate>
		<dc:creator>cplotts</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Snoop]]></category>
		<category><![CDATA[TipsAndTricks]]></category>

		<guid isPermaLink="false">http://www.cplotts.com/2011/02/10/snoop-tips-tricks-1-ctrl-shift-mouse-over/</guid>
		<description><![CDATA[I am always surprised how many people don’t know about this trick … but I guess it isn’t really obvious since I removed the tip from the status bar … in favor of some keyboard functionality. I thought the best way to show this trick off … is with a screencast. Enjoy! Snoop Tips &#038; [...]]]></description>
			<content:encoded><![CDATA[<p>I am always surprised how many people don’t know about this trick … but I guess it isn’t really obvious since I removed the tip from the status bar … in favor of some keyboard functionality.</p>
<p>I thought the best way to show this trick off … is with a screencast. Enjoy!</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:c3ba1319-cfa3-493b-9db4-b88cc1db33e9" class="wlWriterEditableSmartContent">
<div><object width="448" height="336"><param name="movie" value="http://www.youtube.com/v/n8EdRR0Tc1k?hl=en&amp;hd=1"></param><embed src="http://www.youtube.com/v/n8EdRR0Tc1k?hl=en&amp;hd=1" type="application/x-shockwave-flash" width="448" height="336"></embed></object></div>
<div style="width:448px;clear:both;font-size:.8em">Snoop Tips &#038; Tricks #1: Ctrl-Shift Mouse Over</div>
</div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.cplotts.com%2F2011%2F02%2F10%2Fsnoop-tips-tricks-1-ctrl-shift-mouse-over%2F&amp;title=Snoop%20Tips%20%26amp%3B%20Tricks%20%231%3A%20Ctrl-Shift%20Mouse%20Over" id="wpa2a_4">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.cplotts.com/2011/02/10/snoop-tips-tricks-1-ctrl-shift-mouse-over/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Snoop: Now Supports WPF 4.0 Even Better in Snoop v2.6.1</title>
		<link>http://www.cplotts.com/2011/02/10/snoop-now-supports-wpf-4-0-even-better-in-snoop-v2-6-1/</link>
		<comments>http://www.cplotts.com/2011/02/10/snoop-now-supports-wpf-4-0-even-better-in-snoop-v2-6-1/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 01:07:22 +0000</pubDate>
		<dc:creator>cplotts</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Snoop]]></category>

		<guid isPermaLink="false">http://www.cplotts.com/2011/02/10/snoop-now-supports-wpf-4-0-even-better-in-snoop-v2-6-1/</guid>
		<description><![CDATA[Problems, Problems The above blog post title is supposed to be kind of a joke. I keep telling people I’m funny. Snoop supposedly has been supporting WPF 4.0 for some time now. Unfortunately, however, there were times where (1, 2) WPF 4.0 applications weren’t showing up in the App Chooser. In one situation, PresentationFramework.dll wasn’t [...]]]></description>
			<content:encoded><![CDATA[<h2>Problems, Problems</h2>
<p>The above blog post title is supposed to be kind of a joke. <em>I keep telling people I’m funny. </em><a href="http://snoopwpf.codeplex.com">Snoop</a> supposedly has been supporting WPF 4.0 for <a href="http://www.cplotts.com/2010/02/14/snoop-now-supports-wpf-4-0/">some time</a> now. Unfortunately, however, there were times where (<a href="http://snoopwpf.codeplex.com/workitem/5964">1</a>, <a href="http://snoopwpf.codeplex.com/workitem/6090">2</a>) WPF 4.0 applications weren’t showing up in the App Chooser.</p>
<p>In one situation, PresentationFramework.dll wasn’t showing up in the list of loaded modules for the application being Snooped. So, I simply started searching for any of the following assemblies: PresentationFramework.dll, PresentationCore.dll, or wpfgfx_v0400.dll.</p>
<p>But, that didn’t work in all situations.</p>
<p>For sometimes, PresentationFramework.dll shows up as PresentationFramework.ni.dll which I believe is the <a href="http://msdn.microsoft.com/en-us/library/6t9t5wcf(v=VS.100).aspx">Ngen(ed)</a> version of the assembly. At other times, it isn’t wpfgfx_v0400.dll that shows up in the list of modules, but wpfgfx_v0300.dll. The former is the <a href="http://msdn.microsoft.com/en-us/library/ms750441.aspx">milcore</a> for WPF 4.0 and the latter is the milcore for WPF 3.5.</p>
<p>At this point, I just searched for the roots of all these names, i.e. PresentationFramework, PresentationCore, and wpfgfx.</p>
<p>But, again … that didn’t work in all situations. <em>Humility, is a virtue … humility is a virtue. <img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-annoyed" alt="Annoyed" src="http://www.cplotts.com/wp-content/uploads/2011/02/wlEmoticon-annoyed.png" /></em></p>
<p>For some reason, at times, these modules show up in lower case. Don’t ask me why. If someone can shed light on this, please do. So, I’m now searching for the roots of these assemblies in a case-insensitive way. <em>Granted, I probably should have seen that one coming.</em></p>
<h2>Snoop v2.6.1</h2>
<p>Now announcing <a href="http://snoopwpf.codeplex.com/releases/view/49037">Snoop v2.6.1</a>!</p>
<p>Snoop v2.6.1 fixes these issues and others. After yet another <a href="http://snoopwpf.codeplex.com/discussions/245502">fellow</a> experienced this problem and since more people are going WPF 4.0 all the time … I figured it was time for a release.</p>
<p>This release also contains some usability improvements from fellow Snoop aficionado, <a href="http://blogs.interknowlogy.com/author/danhanan/">Dan Hanan</a>. In particular:</p>
<ol>
<li>You can now delve properties by double clicking on the name. </li>
<li>You can now modify the filter sets to contain what you wish to be filtered. </li>
<li>You can now use the mouse wheel to modify property values. </li>
</ol>
<ol>I also want to say that I have a whole bunch of things lined up for integration into Snoop, but have been struggling to find time. For example, another fellow added the ability to capture some hi-res screen shots from Snoop. So, there is definitely going to be a vNext for Snoop … and hopefully soon.</ol>
<h2>Snoop Tips &amp; Tricks</h2>
<p>For a while now, I’ve been contemplating a blog series on Snoop where I highlight different tips and tricks, and in general, how to use Snoop. And with this release, I’m going to kick it off with the most important one of them all: the <a href="http://www.cplotts.com/2011/02/10/snoop-tips-tricks-1-ctrl-shift-mouse-over/">Ctrl-Shift Mouse Over trick</a>.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.cplotts.com%2F2011%2F02%2F10%2Fsnoop-now-supports-wpf-4-0-even-better-in-snoop-v2-6-1%2F&amp;title=Snoop%3A%20Now%20Supports%20WPF%204.0%20Even%20Better%20in%20Snoop%20v2.6.1" id="wpa2a_6">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.cplotts.com/2011/02/10/snoop-now-supports-wpf-4-0-even-better-in-snoop-v2-6-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Snoop: Yes, You Can Snoop XBAPs</title>
		<link>http://www.cplotts.com/2011/01/17/yes-you-can-snoop-xbaps/</link>
		<comments>http://www.cplotts.com/2011/01/17/yes-you-can-snoop-xbaps/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 18:51:17 +0000</pubDate>
		<dc:creator>cplotts</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Snoop]]></category>

		<guid isPermaLink="false">http://www.cplotts.com/2011/01/17/yes-you-can-snoop-xbaps/</guid>
		<description><![CDATA[Today I got a question about whether Snoop supports XBAPs. Actually, this is something I’ve been meaning to look into for a while. So, I took the two necessary seconds to create a test XBAP project and tried Snooping. It didn’t work. When launching Snoop after running the XBAP, you see PresentationHost.exe in the App [...]]]></description>
			<content:encoded><![CDATA[<p>Today I got a question about whether Snoop supports XBAPs. Actually, this is something I’ve been meaning to look into for a while.</p>
<p>So, I took the two necessary seconds to create a test XBAP project and tried Snooping. It didn’t work. When launching Snoop after running the XBAP, you see PresentationHost.exe in the App Chooser (PresentationHost.exe is the process that the browser launches in the case of an XBAP).</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image21.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb21.png" border="0" alt="image" width="521" height="30" /></a></p>
<p>However, trying to Snoop it (clicking the binoculars) … results in … nothing, not even an error.</p>
<p>Now, the person asking … pointed out a <a href="http://joshsmithonwpf.wordpress.com">Josh Smith’s</a> blog <a href="http://joshsmithonwpf.wordpress.com/2008/06/10/three-tips-for-working-with-xbap/">post</a> on the matter … where he discusses three tips for working with XBAPs … one of which is that Snoop doesn’t work, but that <a href="http://karlshifflett.wordpress.com/mole-for-visual-studio/">Mole</a> does. In order to get Mole to work, however, you must (at least temporarily) make your XBAP a full trust application.</p>
<p>Hmm. That got me thinking. <em>Yes, I know that is dangerous.</em></p>
<p>A lot of my efforts with Snoop to date … have revolved around getting edge case scenarios to work … and I have modified the start up process significantly. So, I thought, I should quickly check to see if Snoop now works … as long as I change the XBAP to a full trust application.</p>
<p>And … woohoo … it works! <img class="wlEmoticon wlEmoticon-thumbsup" style="border-style: none;" src="http://www.cplotts.com/wp-content/uploads/2011/01/wlEmoticon-thumbsup.png" alt="Thumbs up" /></p>
<p>So, all you need to do is go to the Project Properties window, navigate to the Security tab, and check ‘This is a full trust application’.</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image22.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb22.png" border="0" alt="image" width="629" height="442" /></a></p>
<p>Hope that helps, and yeah, Snoop rules!</p>
<p>p.s.</p>
<p>I did also verify (while writing up this post) that neither Snoop 1.0 (<a href="http://blois.us/Snoop/">Pete Blois’</a> original version) nor Snoop 2.0 (Pete Blois’ newer stylized version) worked with XBAPs.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.cplotts.com%2F2011%2F01%2F17%2Fyes-you-can-snoop-xbaps%2F&amp;title=Snoop%3A%20Yes%2C%20You%20Can%20Snoop%20XBAPs" id="wpa2a_8">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.cplotts.com/2011/01/17/yes-you-can-snoop-xbaps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.NET Reflector Pro: Debugging the .NET Framework Source Code</title>
		<link>http://www.cplotts.com/2011/01/14/net-reflector-pro-debugging-the-net-framework-source-code/</link>
		<comments>http://www.cplotts.com/2011/01/14/net-reflector-pro-debugging-the-net-framework-source-code/#comments</comments>
		<pubDate>Sat, 15 Jan 2011 04:17:55 +0000</pubDate>
		<dc:creator>cplotts</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[DebuggingTricks]]></category>

		<guid isPermaLink="false">http://www.cplotts.com/2011/01/14/net-reflector-pro-debugging-the-net-framework-source-code/</guid>
		<description><![CDATA[The other day, I ran into a situation (see the attached project and here for more info) where I wanted to debug the .NET Framework in order to see how something was working. Unfortunately, Visual Studio’s native support (see Scott Guthrie&#8217;s blog post or Shawn Burke&#8217;s blog post) for doing so was failing me. I [...]]]></description>
			<content:encoded><![CDATA[<p>The other day, I ran into a situation (see the attached <a href="http://www.cplotts.com/wp-content/uploads/2011/01/ContentPresenterExploration.zip">project</a> and <a href="http://agsmith.wordpress.com/2008/07/14/who-set-the-datacontext/">here</a> for more info) where I wanted to debug the .NET Framework in order to see how something was working.</p>
<p>Unfortunately, Visual Studio’s native support (see <a href="http://weblogs.asp.net/scottgu/archive/2008/01/16/net-framework-library-source-code-now-available.aspx">Scott Guthrie&#8217;s blog post</a> or <a href="http://blogs.msdn.com/b/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx">Shawn Burke&#8217;s blog post</a>) for doing so was failing me. I was eventually able to get that working for .NET 4.0 but not .NET 3.5 SP1 (see this forum <a href="http://social.msdn.microsoft.com/Forums/en-US/refsourceserver/thread/1b74f60c-e961-425c-a38e-362406dd4cfe">thread</a>), but in the meantime … I had to turn to other methods.</p>
<p>So, what is one to do when this happens? Is all lost? Not at all, for you can use <a href="http://www.red-gate.com/products/dotnet-development/reflector/features-pro">.NET Reflector Pro</a> to do the same thing.</p>
<p><a href="http://www.red-gate.com/products/dotnet-development/reflector/">.NET Reflector</a> is a very popular .NET utility created by a Microsoft employee, <a href="http://blog.lutzroeder.com/">Lutz Roeder</a>. It allows you to explore and analyze .NET managed assemblies. This utility can also be extended by way of add-ins and there is a whole <a href="http://reflectoraddins.codeplex.com/">bunch</a> of them out there.</p>
<p>A while <a href="http://blog.lutzroeder.com/2008/08/future-of-net-reflector.html">ago</a>, Lutz Roeder, decided to let <a href="http://www.red-gate.com/">Red Gate</a> take the reins, and they then went ahead and added the ability to allow a user to debug into third-party code and assemblies by way of a Visual Studio add-in.</p>
<p>And that is what I’m going to show you how to do, step-by-step.</p>
<h2>Install .NET Reflector Pro</h2>
<p>The first thing that you need to do, obviously, is to download and install .NET Reflector, if you haven’t already. There is a download link <a href="http://www.red-gate.com/products/dotnet-development/reflector/">here</a>.</p>
<p>It comes down as a zip file, so simply extract the contents to a convenient location. Launch it and then select Tools-&gt;Integration Options. Here is the dialog that comes up.</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image.png"><img style="border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb.png" width="515" height="370" /></a></p>
<p>This dialog allows you to easily install the .NET Reflector add-in … into Visual Studio. Choose the versions that you want and click OK.</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image1.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb1.png" width="515" height="154" /></a></p>
<h2>Tell Visual Studio to Disable Optimizations</h2>
<p>The next step is very important. If you forget it, you will be frustrated once you get to actually debugging the source code … because all the variables will be optimized away and Visual Studio will also step through the code in odd ways.</p>
<p>So, go to my earlier blog <a href="http://www.cplotts.com/2009/01/07/disabling-optimizations-when-debugging-net-framework-source-code/">post</a> and follow its instructions. (Also, don’t forget, if you are debugging a Visual Studio 2010 application, to make sure you update the path to devenv.exe … in the .cmd file you create in this step.)</p>
<h2>Choose the Assemblies to Debug</h2>
<p>Next, launch Visual Studio with the .cmd file from the previous step and load up the project that you want to debug. Go to the .NET Reflector menu and select ‘Choose Assemblies to Debug…’</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image2.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb2.png" width="279" height="195" /></a></p>
<p>If you don’t have your options set correctly, the following dialog will come up. Click ‘Turn off “Enable Just My Code”’ to continue.</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image3.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb3.png" width="644" height="356" /></a></p>
<p>Now, choose which assemblies that you wish to debug into … via the following dialog.</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image4.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb4.png" width="644" height="356" /></a></p>
<p>In my case, I want to debug the ContentPresenter.EnsureTemplate method and the ContentPresenter class lives in PresentationFramework.dll. How do I know this? Well, through .NET Reflector, of course.</p>
<h2>Activate .NET Reflector Pro</h2>
<p>Once you click OK to the above dialog, you may get prompted with the following dialog.</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image5.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb5.png" width="558" height="298" /></a></p>
<p>This, unfortunately, brings up an annoying issue. Even though Red Gate has kindly provided a 14-day trial to use the Pro features of the tool … your trial starts when you install the software and not when try to use the debugging feature for first time.</p>
<p>That is, for me, I was never able to take advantage of the trial period as I had long had the software installed (it is always one of the first pieces of software I put on a newly paved development machine).</p>
<p>So, if you are in this situation, go buy a license and then Activate it here.</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image6.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb6.png" width="564" height="417" /></a></p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image7.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb7.png" width="564" height="417" /></a></p>
<h2>Let .NET Reflector Decompile the Assemblies</h2>
<p>5. At this point, .NET Reflector Pro is disassembling the assemblies that you have chosen and also reassembling them so that they can generate .pdb files. This process takes quite a bit of time and so they also stuff the output into the ‘Debug Store’ so that you don’t have to do this every time.</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image8.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb8.png" width="644" height="356" /></a></p>
<p>If you’ve been around the .NET world for a bit, you’ll notice the similarities in the above step to what you had to do manually in this CodeProject <a href="http://www.codeproject.com/KB/dotnet/Debug_Framework_Classes.aspx">article</a>. And, if you recall, what you ended up debugging … was IL, not C# or VB.</p>
<p>Eventually, everything will succeed.</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image9.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb9.png" width="644" height="356" /></a></p>
<h2>Verify Your Tools-&gt;Options Debugging Settings</h2>
<p>At this point, bring up the Tools-&gt;Options dialog and go to the Debugging/General tab. Everything should be fine, but as a point of education … and to verify that everything is okay … make sure that all settings pointed to by the red arrows are set as shown.</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image10.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb10.png" width="644" height="376" /></a></p>
<p>.NET Reflector cleared the first one (‘Enable Just My Code’) for you … but make sure it is unchecked.</p>
<p>Also, make sure that ‘Enable .NET Framework source stepping’ and ‘Enable source server support’ are unchecked. These options are checked when you are using Visual Studio’s native support to debug into the .NET Framework (mentioned above) … but we don’t want them checked now … so that there is no cause for confusion.</p>
<p>Finally, the ‘Require source files to exactly match the original version’ is not strictly necessary. However, I believe I have had issues in the past if this was checked. If you leave it checked, just keep it in mind, so if things aren’t working you can then try unchecking it.</p>
<p>Next, check out the Debugging/Symbols tab. Below, you can see where .NET Reflector has installed the .pdb files. Make sure those locations are checked … and make sure that everything else in that list is unchecked … especially ‘Microsoft Symbol Servers’</p>
<p>And, very importantly, make sure you have a clean symbol cache … by clicking the ‘Empty Symbol Cache’ button. Why is this important? Well, it ensures that all the .pdb files will be coming fresh from Reflector … and won’t be a stale .pdb from a previous effort at trying to use the native Visual Studio support.</p>
<p>What is the Symbol Cache? Well, the Symbol Cache is where the .pdbs are copied to … so that you don’t have to keep downloading them from the Microsoft Symbol Servers … obviously an important option when using the native Visual Studio support … but not super important when dealing with .NET Reflector. However, I believe Reflector’s .pdb files still get copied to the Symbol Cache.</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image11.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb11.png" width="644" height="376" /></a></p>
<h2>Debug the .NET Framework (Call Stack Approach)</h2>
<p>Now, you need to figure out how to set a breakpoint so that you can break into the application and debug the .NET Framework. The first mechanism is just to set a breakpoint on a local (non-framework) method that you know will cause the class of interest to be on the stack. Then you can double click the stack frame and set another breakpoint as necessary.</p>
<p>For example, let us say that I want to debug System.Windows.Application.DoStartup. I know that the Application class will probably be on the stack if I put a breakpoint in the InitializeComponent method of my MainWindow. So, that’s exactly where I put it.</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image12.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb12.png" width="644" height="287" /></a></p>
<p>Now, I click Debug-&gt;Start Debugging (F5) and hopefully I will hit my breakpoint. Sure enough:</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image13.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb13.png" width="644" height="387" /></a></p>
<p>One thing to note here is that gray text indicates that a .pdb has not been loaded for that assembly while black text indicates that a .pdb has been loaded. That is, in the above example, only PresentationFramework has an loaded .pdb.</p>
<p>And, look! Application.DoStartup is on the stack. Double click that stack frame to bring you to the code.</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image14.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb14.png" width="644" height="432" /></a></p>
<p>At this point, you can debug as normal. You can step, watch variables, and more. In the above screen shot, you can see that I set a new breakpoint at the start of the method to be hit when I restart the debugging session. Restarting the application, shows that I can verify that MainWindow.xaml is my StartupUri.</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image15.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb15.png" width="644" height="224" /></a></p>
<h2>Debug the .NET Framework (Method Breakpoint Approach)</h2>
<p>Unfortunately, the above call stack approach to debugging the .NET Framework will only get you so far. Another method I have used in the past is to simply set a breakpoint on a method name. How to do this is not very obvious, though.</p>
<p>The trick is to set a breakpoint via the New-&gt;Break at Function menu item in the Breakpoints debugging window.</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image16.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb16.png" width="524" height="251" /></a></p>
<p>The New Breakpoint dialog comes up. Simply, <em>and carefully</em>, type the name of the method, prefixed by its Class name, like so:</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image17.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb17.png" width="598" height="273" /></a></p>
<p>It will complain, but just click OK.</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image18.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb18.png" width="487" height="175" /></a></p>
<p>At this point, just hit F5 (Debugging-&gt;Start Debugging) and do what you need to do to hit the breakpoint. And, wa la, here I’ve hit my breakpoint:</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image19.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb19.png" width="606" height="320" /></a></p>
<p>The real question that prompted all of this desire to debug the .NET Framework was to see whether the DataContext was getting set or cleared inside of ContentPresenter. And so, I set the following breakpoints and step to my hearts content.</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2011/01/image20.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2011/01/image_thumb20.png" width="599" height="484" /></a></p>
<h2>Summary</h2>
<p>Sometimes, you are up against the wall. You are trying to determine if the .NET Framework has a bug in it … or you’re just trying to get a better grasp about what is really going on in that big black box.</p>
<p>And, while debugging the .NET Framework is best done natively inside of Visual Studio (it’s easier and you can see comments in the source code), it doesn’t always seem to work. Sometimes the assembly you are trying to debug is not supported and at other times the symbol servers don’t seem to be up to date with the released bits.</p>
<p>However, .NET Reflector Pro can come to your rescue in these situations. It can also debug any third-party assembly, regardless of whether it’s Microsoft’s or not.</p>
<p>Good hunting … I hope this helps someone out! Leave a comment if it does!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.cplotts.com%2F2011%2F01%2F14%2Fnet-reflector-pro-debugging-the-net-framework-source-code%2F&amp;title=.NET%20Reflector%20Pro%3A%20Debugging%20the%20.NET%20Framework%20Source%20Code" id="wpa2a_10">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.cplotts.com/2011/01/14/net-reflector-pro-debugging-the-net-framework-source-code/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Snoop: There can be only one!</title>
		<link>http://www.cplotts.com/2010/06/25/snoop-there-can-be-only-one/</link>
		<comments>http://www.cplotts.com/2010/06/25/snoop-there-can-be-only-one/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 23:57:23 +0000</pubDate>
		<dc:creator>cplotts</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Snoop]]></category>

		<guid isPermaLink="false">http://www.cplotts.com/2010/06/25/snoop-there-can-be-only-one/</guid>
		<description><![CDATA[Haven’t I already said that the community has just been awesome in regards to Snoop? Well, here is another piece of evidence! The other day, a developer, Bruno Martinez, from Uruguay contacted me and wanted to contribute to Snoop by making it so that there was only 1 version, instead of the 4 currently required [...]]]></description>
			<content:encoded><![CDATA[<p>Haven’t I already <a href="http://channel9.msdn.com/posts/Psychlist1972/Pete-at-MIX10-Cory-Plotts-on-Snoop-for-WPF/">said</a> that the community has just been awesome in regards to Snoop?</p>
<p>Well, here is another piece of evidence!</p>
<p>The other day, a developer, <a href="http://www.bigmostacho.com/">Bruno Martinez</a>, from Uruguay contacted me and wanted to contribute to Snoop by making it so that there was only 1 version, instead of the 4 currently required at that point.</p>
<p>If you recall …</p>
<ol>
<li>You needed a version for WPF 3.5 and 32-bit.</li>
<li>You needed a version for WPF 3.5 and 64-bit.</li>
<li>You needed a version for WPF 4.0 and 32-bit.</li>
<li>You needed a version for WPF 4.0 and 64-bit.</li>
</ol>
<p>Yuck! <em>Of course, it was better than not being able to Snoop in those situations.</em> <img src='http://www.cplotts.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Well, after integrating Bruno’s changes … you just need:</p>
<ol>
<li>Snoop</li>
</ol>
<p><a href="http://www.cplotts.com/wp-content/uploads/2010/06/SnoopAppChooserNoLabels.png"><img style="display: inline; border: 0px;" title="SnoopAppChooserNoLabels" src="http://www.cplotts.com/wp-content/uploads/2010/06/SnoopAppChooserNoLabels_thumb.png" border="0" alt="SnoopAppChooserNoLabels" width="521" height="29" /></a></p>
<p>Yeah, that’s right. There are no labels! <strong>Thank you, Bruno!</strong></p>
<p>I’m obviously tickled by this … since it was a usability nightmare trying to figure out what version you needed to run … but there are host of other fixes/improvements as well. In particular, the Snoop start-up process is much more robust than it used to be and it can handle some fringe cases that it wasn’t able to before.</p>
<p>Please go to <a href="http://snoopwpf.codeplex.com">http://snoopwpf.codeplex.com</a> for more info, and of course, the download/release area for <a href="http://snoopwpf.codeplex.com/releases/view/47822">version 2.6.0.</a></p>
<p>Happy Snooping!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.cplotts.com%2F2010%2F06%2F25%2Fsnoop-there-can-be-only-one%2F&amp;title=Snoop%3A%20There%20can%20be%20only%20one%21" id="wpa2a_12">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.cplotts.com/2010/06/25/snoop-there-can-be-only-one/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Snoop: Now Supports WPF 4.0</title>
		<link>http://www.cplotts.com/2010/02/14/snoop-now-supports-wpf-4-0/</link>
		<comments>http://www.cplotts.com/2010/02/14/snoop-now-supports-wpf-4-0/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 19:18:59 +0000</pubDate>
		<dc:creator>cplotts</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Snoop]]></category>

		<guid isPermaLink="false">http://www.cplotts.com/2010/02/14/snoop-now-supports-wpf-4-0/</guid>
		<description><![CDATA[This is just a quick post to point people to the fact that I have updated Snoop on CodePlex (http://snoopwpf.codeplex.com/) such that it now supports WPF 4.0. If you try to Snoop a WPF 4.0 application with the WPF 3.5 version, you will get the following error message: I speculate that this is because there is [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a quick post to point people to the fact that I have updated Snoop on CodePlex (<a title="http://snoopwpf.codeplex.com/" href="http://snoopwpf.codeplex.com/">http://snoopwpf.codeplex.com/</a>) such that it now supports WPF 4.0.</p>
<p>If you try to Snoop a WPF 4.0 application with the WPF 3.5 version, you will get the following error message:</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2010/02/SnoopError.png"><img style="display: inline; border: 0px;" title="SnoopError" src="http://www.cplotts.com/wp-content/uploads/2010/02/SnoopError_thumb.png" border="0" alt="SnoopError" width="435" height="175" /></a></p>
<p>I speculate that this is because there is a brand new CLR with .NET 4.0 (WPF 4.0) applications. Yes, that’s right, a brand new CLR. We haven’t had one of those for a while.</p>
<p>If someone can confirm this or provide a better understanding of why I can’t Snoop WPF 4.0 applications without retargeting Snoop to .NET 4.0 … please shed some light for me.</p>
<p>So, there are now 4, count them, 4 versions of Snoop:</p>
<ol>
<li>Snoop 32-bit for WPF 3.5</li>
<li>Snoop 64-bit for WPF 3.5</li>
<li>Snoop 32-bit for WPF 4.0</li>
<li>Snoop 64-bit for WPF 4.0</li>
</ol>
<ol>You need to use the right version of Snoop in each particular situation … otherwise … thar will be problems, matey!</ol>
<p>I have also added another label to the app chooser so that you know which version you currently have up. Take a look … this is what it looks like for the 64-bit/WPF 4.0 version:</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2010/02/image.png"><img style="display: inline; border: 0px;" title="image" src="http://www.cplotts.com/wp-content/uploads/2010/02/image_thumb.png" border="0" alt="image" width="468" height="30" /></a></p>
<p>Let me know if you have any problems by creating a discussion (or participating in a current one) on the <a href="http://snoopwpf.codeplex.com">http://snoopwpf.codeplex.com</a> site.</p>
<p>Enjoy and happy Snooping! <img src='http://www.cplotts.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.cplotts.com%2F2010%2F02%2F14%2Fsnoop-now-supports-wpf-4-0%2F&amp;title=Snoop%3A%20Now%20Supports%20WPF%204.0" id="wpa2a_14">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.cplotts.com/2010/02/14/snoop-now-supports-wpf-4-0/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Snoop: Now on CodePlex</title>
		<link>http://www.cplotts.com/2010/02/11/snoop-now-on-codeplex/</link>
		<comments>http://www.cplotts.com/2010/02/11/snoop-now-on-codeplex/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 18:25:15 +0000</pubDate>
		<dc:creator>cplotts</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Snoop]]></category>

		<guid isPermaLink="false">http://www.cplotts.com/2010/02/11/snoop-now-on-codeplex/</guid>
		<description><![CDATA[  Snoop is now on CodePlex at snoopwpf.codeplex.com The community reception to my efforts (blog posts: 1, 2, 3) on Snoop have been wonderful. Some like Anvaka have offered additional feature suggestions; others have just encouraged me. In my last post, a fellow commented asking why it wasn’t up on CodePlex. Well, this was a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cplotts.com/wp-content/uploads/2010/02/CP_banner_111x111_gen.jpg"><img style="display: inline; border: 0px;" title="CP_banner_111x111_gen" src="http://www.cplotts.com/wp-content/uploads/2010/02/CP_banner_111x111_gen_thumb.jpg" border="0" alt="CP_banner_111x111_gen" width="115" height="115" /></a> </p>
<h2>Snoop is now on CodePlex at <a href="http://snoopwpf.codeplex.com">snoopwpf.codeplex.com</a></h2>
<p>The community reception to my <a href="http://www.cplotts.com/2009/12/08/snoop-now-with-64-bit-support-and-more/">efforts</a> (blog posts: <a href="http://www.cplotts.com/2009/04/04/snoop-20-now-works-in-wpf-interop-scenarios/">1</a>, <a href="http://www.cplotts.com/2009/04/13/snoop-now-works-in-wpf-interop-scenarios-part-ii/">2</a>, <a href="http://www.cplotts.com/2009/12/08/snoop-now-with-64-bit-support-and-more/">3</a>) on Snoop have been wonderful. Some like <a href="http://vivalution.blogspot.com/">Anvaka</a> have offered additional feature suggestions; <a href="http://blogs.msdn.com/peterlau/archive/2010/02/10/connected-show-23-addicted-to-spring-net.aspx">others</a> have just encouraged me.</p>
<p>In my last post, a fellow commented asking why it wasn’t up on CodePlex. Well, this was a great suggestion and one that I had actually already considered. That prompted me to email <a href="http://blois.us/blog/">Pete Blois</a> (the original author) for his permission. He graciously gave it and so I then proceeded to put it up there.</p>
<p>It took me a little while, but I now have the initial bits uploaded … that is, the same stuff that is available here at my blog.</p>
<p>Now, there are a <strong>bunch</strong> of things on the todo list. Most notably, <strong>I’ve already modified Snoop so that it works for WPF 4.0</strong> … and definitely want to share that with the world.</p>
<p>So, please be patient, I’ll get to it. Those silly day jobs! <img src='http://www.cplotts.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<h2>Some Info</h2>
<p>If you are going to download the source code and build it, some comments are in order (I’ll put this out at the CodePlex site too).</p>
<p>There are (go to Build-&gt;Configuration Manager) 3 solution platforms (x86, x64, Any CPU) and 2 solution configurations (Debug, Release). The x86 platform is for 32-bit, the x64 platform is obviously for 64-bit, but … what is Any CPU?</p>
<p>Well, Any CPU is only around for Blendability. That is, for some odd reason, I couldn’t bring up the Blend designer Snoop’s window unless it was in this configuration.<strong> I have intentionally marked the ManagedInjector project to not be built under the Any CPU configuration. </strong>Since Any CPU will run as 32-bit on 32-bit operating systems and as 64-bit on 64-bit operating systems, using Any CPU will likely cause a mismatch (and a headache <img src='http://www.cplotts.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ) with the ManagedInjector dll.  The project which builds the ManagedInjector.dll is a C++ project and there isn’t an Any CPU setting for those (they can only be specifically built to Win32 or x64).</p>
<p>Or, in other words, <strong>make sure you switch into another platform, before you build or the build will fail.</strong></p>
<p>Here’s a chart for quick reference:</p>
<table border="1" cellspacing="0" cellpadding="2" width="595">
<tbody>
<tr>
<td width="96" valign="top"><strong>Platform</strong></td>
<td width="130" valign="top"><strong>Configuration</strong></td>
<td width="368" valign="top"><strong>Notes</strong></td>
</tr>
<tr>
<td width="96" valign="top">x86</td>
<td width="130" valign="top">Debug</td>
<td width="368" valign="top">For 32-bit.</td>
</tr>
<tr>
<td width="96" valign="top">x86</td>
<td width="130" valign="top">Release</td>
<td width="368" valign="top">For 32-bit, builds the installer.</td>
</tr>
<tr>
<td width="96" valign="top">x64</td>
<td width="130" valign="top">Debug</td>
<td width="368" valign="top">For 64-bit.</td>
</tr>
<tr>
<td width="96" valign="top">x64</td>
<td width="130" valign="top">Release</td>
<td width="368" valign="top">For 64-bit, builds the installer.</td>
</tr>
<tr>
<td width="96" valign="top">Any CPU</td>
<td width="130" valign="top">Debug, Release</td>
<td width="368" valign="top"><strong>Only for Blendability. Do not use.</strong></td>
</tr>
</tbody>
</table>
<p> </p>
<h2>Call to Action</h2>
<p>If you have a feature request or want to be involved somehow (maybe as a contributor), please don’t hesitate to <a href="http://www.cplotts.com/contact/">contact</a> me.</p>
<p>For near future though, I’m going to keep the project closed until I can change the copyright info to Ms-PL and clean up the code a bit.</p>
<h2>Thanks</h2>
<p>Finally, I want to publicly thank Pete Blois for first creating this awesome <a href="http://blois.us/Snoop/">tool</a> and for giving us the permission to get it going on CodePlex. A big thanks Pete!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.cplotts.com%2F2010%2F02%2F11%2Fsnoop-now-on-codeplex%2F&amp;title=Snoop%3A%20Now%20on%20CodePlex" id="wpa2a_16">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.cplotts.com/2010/02/11/snoop-now-on-codeplex/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Snoop: Now with 64-bit Support and More</title>
		<link>http://www.cplotts.com/2009/12/08/snoop-now-with-64-bit-support-and-more/</link>
		<comments>http://www.cplotts.com/2009/12/08/snoop-now-with-64-bit-support-and-more/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 18:01:37 +0000</pubDate>
		<dc:creator>cplotts</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Snoop]]></category>

		<guid isPermaLink="false">http://www.cplotts.com/2009/12/08/snoop-now-with-64-bit-support-and-more/</guid>
		<description><![CDATA[The other day I was rebuilding an application such that it would specifically target the x86 platform … solely because I wanted to Snoop it. I’ve done this many, many times because it is the only way I’ve been able to Snoop applications on my Windows 7 64-bit operating system. And, I thought, “Boy, this [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I was rebuilding an application such that it would specifically target the x86 platform … solely because I wanted to Snoop it.</p>
<p>I’ve done this many, many times because it is the only way I’ve been able to Snoop applications on my Windows 7 64-bit operating system. And, I thought, “Boy, this is stupid. I should be able to build a 64-bit version of Snoop such that I don’t have to do this anymore.”</p>
<p>And that is exactly what I did.</p>
<p>Now … presenting Snoop 32-bit!</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2009/12/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2009/12/image_thumb.png" width="428" height="30" /></a></p>
<p>And Snoop 64-bit!</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2009/12/image1.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2009/12/image_thumb1.png" width="428" height="30" /></a></p>
<p><strike>Here are the binaries for the </strike><strike>32-bit</strike><strike> version and here are the binaries for the </strike><strike>64-bit</strike><strike> version.</strike></p>
<p><em>(The binaries are now (see posts: </em><a href="http://www.cplotts.com/2010/02/11/snoop-now-on-codeplex/"><em>1</em></a><em>, </em><a href="http://www.cplotts.com/2010/02/14/snoop-now-supports-wpf-4-0/"><em>2</em></a><em>) up on </em><a href="http://snoopwpf.codeplex.com/"><em>CodePlex</em></a><em>. Please go download it from there as those binaries will contain the latest and greatest bits.)</em></p>
<p>It was rather a simple matter really. I just needed to change all the project configurations so that they targeted the x64 platform … for the x64 version of Snoop … and all the project configurations so that they targeted the x86 platform … for the x86 version of Snoop.</p>
<p>This was so easy and worked so nicely … that I searched the internet to see if anyone had done this already … and I found <a href="http://team.interknowlogy.com/blogs/danhanan/">Dan Hanan’s</a> nice <a href="http://team.interknowlogy.com/blogs/danhanan/archive/2009/07/15/64-bit-snoop-for-wpf-development.aspx">post</a> on the matter.</p>
<p>The problem, though, was that he did it for original version of Snoop … and not the nicely styled and improved version that <a href="http://blois.us/blog/">Pete Blois</a> currently is making <a href="http://blois.us/Snoop/">available</a> since property editing was originally (still?) broken in that version. However, he also had several nice usability features that I was drooling over and wanted for my very own. <img src='http://www.cplotts.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  And I, of course, have already fixed the property editing issue in my version (see previous posts: <a href="http://www.cplotts.com/2009/04/04/snoop-20-now-works-in-wpf-interop-scenarios/">1</a>, <a href="http://www.cplotts.com/2009/04/13/snoop-now-works-in-wpf-interop-scenarios-part-ii/">2</a>) with a little help from <a href="http://www.shunra.com/shunrablog/index.php/2009/07/21/a-fix-to-the-awesome-wpf-snoop-utility/">Mark Kharitonov</a> (see this forum <a href="http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b99f3db7-540c-43f4-8051-69d2d51a78bc">post</a> for more info on that).</p>
<p>So, I emailed him, got his permission to integrate those changes, and promptly did so. I also added a few improvements myself.</p>
<h2>The Improvements</h2>
<p>Here is what has been improved (over and above Pete Blois’ current version):</p>
<table border="1" cellspacing="0" cellpadding="2" width="595">
<tbody>
<tr>
<td valign="top" width="435"><strong>Improvement</strong></td>
<td valign="top" width="158"><strong>Originator</strong></td>
</tr>
<tr>
<td valign="top" width="435">Handles WPF interop scenarios (both Windows Forms hosting WPF and WPF hosting Windows Forms).</td>
<td valign="top" width="158">Cory Plotts</td>
</tr>
<tr>
<td valign="top" width="435">Fixed the ability to edit properties.</td>
<td valign="top" width="158">Mark Kharitonov</td>
</tr>
<tr>
<td valign="top" width="435">Modified Snoop so that it can handle visual trees that have nesting greater than 255 levels deep.</td>
<td valign="top" width="158">Mark Kharitonov</td>
</tr>
<tr>
<td valign="top" width="435">Modified the project configurations so that you can build a 32-bit version and a 64-bit version. <em>This is what the blog post is all about! Ha!</em></td>
<td valign="top" width="158">Cory Plotts         <br />Dan Hanan</td>
</tr>
<tr>
<td valign="top" width="435">Turned off the showing of properties at their default value (by untoggling the Show Defaults toggle button).</td>
<td valign="top" width="158">Dan Hanan</td>
</tr>
<tr>
<td valign="top" width="435">Turned auto refresh off in the AppChooser. Snoop was previously polling every 20 seconds for new applications.</td>
<td valign="top" width="158">Dan Hanan</td>
</tr>
<tr>
<td valign="top" width="435">Added a checkbox to turn auto refresh back on (if you so desire).</td>
<td valign="top" width="158">Dan Hanan</td>
</tr>
<tr>
<td valign="top" width="435">Added a label to the AppChooser to indicate 32-bit versus 64-bit.</td>
<td valign="top" width="158">Dan Hanan</td>
</tr>
<tr>
<td valign="top" width="435">Added a wait cursor when the AppChooser is busy iterating over the applications to possibly Snoop.</td>
<td valign="top" width="158">Dan Hanan</td>
</tr>
<tr>
<td valign="top" width="435">Added the capability to bring the selected tree view item into view.</td>
<td valign="top" width="158">Dan Hanan</td>
</tr>
<tr>
<td valign="top" width="435">Added the capability to filter properties based on predefined sets of properties.</td>
<td valign="top" width="158">Dan Hanan</td>
</tr>
<tr>
<td valign="top" width="435">Added the ability to pop the target (after a delve) with the back button on the mouse.</td>
<td valign="top" width="158">Dan Hanan</td>
</tr>
<tr>
<td valign="top" width="435">Modified the selected item in the tree view to be a light blue even when it doesn’t have focus.</td>
<td valign="top" width="158">Dan Hanan</td>
</tr>
<tr>
<td valign="top" width="435">Added the ability to pop the target (after a delve) with the alt-left arrow keyboard sequence.</td>
<td valign="top" width="158">Cory Plotts</td>
</tr>
<tr>
<td valign="top" width="435">Added the ability to remember window position, size, and the maximized/minimized/normal state for all three Snoop windows.</td>
<td valign="top" width="158">Cory Plotts</td>
</tr>
<tr>
<td valign="top" width="435">Removed the filtering of ‘devenv’ out from the list of applications that you can Snoop.</td>
<td valign="top" width="158">Cory Plotts</td>
</tr>
<tr>
<td valign="top" width="435"><span style="text-decoration: line-through">Modified the project configurations so that it never builds the installer. I just copy the Snoop executable and the ManagedInjector dll from place to place. <em>Don’t know if this an improvement. <img src='http://www.cplotts.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </em></span></td>
<td valign="top" width="158">Cory Plotts</td>
</tr>
<tr>
<td valign="top" width="435">Fixed the x86 installer and created an installer for x64. Snoop is no longer being added to the GAC and the assemblies are thus no longer strong named. The installers for both platforms should now work.</td>
<td valign="top" width="158">Cory Plotts</td>
</tr>
<tr>
<td valign="top" width="435">Integrated <a href="http://vivalution.blogspot.com/">Anvaka</a>’s great suggestion below (see the comments). That is, I moved the long label that tells a user how to ctrl-shift click on the application being Snoop(ed) (to a tool tip on the tree view) … and replaced it with a label that tells the user what the immediate following hyperlink is … that is, the Keyboard.FocusedElement. Also added another label and hyperlink for the current selection’s focus scope.</td>
<td valign="top" width="158">Andrei Kashcha (Anvaka)</td>
</tr>
</tbody>
</table>
<p>I chose not to integrate a couple of Dan Hanan’s changes. First, I did not integrate the ‘indexer delve’. Well, actually I did, but then noticed that Pete Blois’ new version already allowed you to delve into items in a collection … and so I backed it out.</p>
<p>Second, I did not integrate the ‘use 2nd monitor if present’ feature. I liked that feature but thought that I would try to improve upon it by remembering the position and size of all the windows … regardless of the number of monitors. So, with a little help from this StackOverflow <a href="http://stackoverflow.com/questions/847752/net-wpf-remember-window-size-between-sessions">question</a> and this MSDN <a href="http://msdn.microsoft.com/en-us/library/aa972163.aspx">sample</a> … that is what I did. It seems to work nicely. Let me know if you have any problems with it.</p>
<h2>Snoop(ing) Visual Studio 2010</h2>
<p>Finally, ever since I’ve installed Visual Studio 2010, I’ve wanted to take a peek under the covers with Snoop (remember … Microsoft used WPF in this latest version of Visual Studio). I originally thought I couldn’t Snoop it … because it was running as a 64-bit application and I only had a 32-bit version of Snoop.</p>
<p>So, when I got the 64-bit version of Snoop going, I quickly tried Snooping Visual Studio 2010. No luck! Bringing up task manager, I quickly remembered that Visual Studio runs as a 32-bit application on 64-bit operating systems. See this <a href="http://blogs.msdn.com/ricom/archive/2009/06/10/visual-studio-why-is-there-no-64-bit-version.aspx">post</a> by <a href="http://blogs.msdn.com/ricom/default.aspx">Rico Mariani</a> for more info.</p>
<p>As I have recently been invited into the <a href="http://groups.google.com/group/wpf-disciples?hl=en">WPF Disciples</a> group, I posed the question <a href="http://groups.google.com/group/wpf-disciples/browse_frm/thread/70b94cf0fc67a086?hl=en">there</a>. Imagine my surprise to find out that devenv.exe was manually being filtered out (since Visual Studio 2008 would load WPF assemblies … but Snoop would fail since Visual Studio 2008 wasn’t built with WPF).</p>
<p>That gave me quite the chuckle. Or, more like, duh! So, promptly removed that and Snoop(ed) Visual Studio 2010 to my delight (check out the red Snoop adorner):</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2009/12/image2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2009/12/image_thumb2.png" width="599" height="484" /></a></p>
<p>And, of course, the Snoop AppChooser:</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2009/12/image3.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2009/12/image_thumb3.png" width="568" height="30" /></a></p>
<p>And, finally, the main Snoop user interface:</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2009/12/image4.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.cplotts.com/wp-content/uploads/2009/12/image_thumb4.png" width="599" height="484" /></a></p>
<p>I think that is <strong>so cool</strong>. Ok, I know … I need mental help. <img src='http://www.cplotts.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<h2>The Source Code</h2>
<p><strike>In the past, I have not released the source code since I have wanted to get Pete’s permission before I do so. I actually met him at PDC 2009 this year. I brought up the fact that I had modified Snoop to handle interop scenarios … but I forgot to ask him about the source code!</strike></p>
<p><strike>There are so many changes now … that I think it would be counter-productive to not release it … in case someone else wants to take Snoop even further than I (and Dan and Mark) have. <em>If you do modify it … and take it further … please let me know! I would love the chance to determine whether to integrate the changes into this version.</em></strike></p>
<p><strike>So, here it is: the </strike><strike>source code</strike><strike>.</strike></p>
<p><em>(The source code is now (see posts: </em><a href="http://www.cplotts.com/2010/02/11/snoop-now-on-codeplex/"><em>1</em></a><em>, </em><a href="http://www.cplotts.com/2010/02/14/snoop-now-supports-wpf-4-0/"><em>2</em></a><em>) up on </em><a href="http://snoopwpf.codeplex.com/"><em>CodePlex</em></a><em>. Please go download it from there as that code will contain the latest and greatest bits.)</em></p>
<p>Enjoy!</p>
<p>p.s. If you were one of the few who pulled down the binaries immediately after I posted it, then you may not have gotten the Snoop.exe.config file. Unfortunately, in this case, Snoop does not seem to close down all the way (i.e. I had to manually kill it through task manager). You’ll want to get the latest binaries that do include the Snoop.exe.config file … or manually rebuild them yourself with the source code.</p>
<h2>An Update</h2>
<p>See above (in the table of improvements), but I fixed the installers and integrated a nice idea by Anvaka. All the attached binaries (which should be installers now) and source code have been updated.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.cplotts.com%2F2009%2F12%2F08%2Fsnoop-now-with-64-bit-support-and-more%2F&amp;title=Snoop%3A%20Now%20with%2064-bit%20Support%20and%20More" id="wpa2a_18">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.cplotts.com/2009/12/08/snoop-now-with-64-bit-support-and-more/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
		<item>
		<title>An Ode to wfSpy</title>
		<link>http://www.cplotts.com/2009/10/28/an-ode-to-wfspy/</link>
		<comments>http://www.cplotts.com/2009/10/28/an-ode-to-wfspy/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 21:06:29 +0000</pubDate>
		<dc:creator>cplotts</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[Windows Forms]]></category>

		<guid isPermaLink="false">http://www.cplotts.com/2009/10/28/an-ode-to-wfspy/</guid>
		<description><![CDATA[As I’ve mentioned before, I love user interface spying utilities and often find myself championing their use. Today, I got a message from someone requesting the modifications we made to wfSpy. I’ve always wanted to publish them back to the community and tried to do so by contacting the original author. However, I never got [...]]]></description>
			<content:encoded><![CDATA[<p>As I’ve mentioned <a href="http://www.cplotts.com/2009/04/04/snoop-20-now-works-in-wpf-interop-scenarios/">before</a>, I love user interface spying utilities and often find myself championing their use.</p>
<p>Today, I got a <a href="http://www.codeproject.com/KB/dotnet/wfspy.aspx?msg=1540831#xx1540831xx">message</a> from someone requesting the modifications we made to <a href="http://www.codeproject.com/KB/dotnet/wfspy.aspx">wfSpy</a>. I’ve always wanted to publish them back to the community and tried to do so by contacting the original <a href="http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=15383">author</a>. However, I never got any response.</p>
<p>wfSpy stands for Windows Forms Spy and so it is a spying utility for Windows Forms applications (and specifically for .NET 2.0 and forward). It is similar to <a href="http://www.codeplex.com/hawkeye">Hawkeye</a>, but is easier to use … and doesn’t have quite as much functionality.</p>
<p>We made several modifications to it but the notable two are as follows.</p>
<p>First off, a colleague (<a href="http://spookycoding.blogspot.com/">Don Kackman</a>) of mine added the crosshairs ability. Take a look at the main window that comes up when you launch it.</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2009/10/image1.png"><img style="display: inline; border-width: 0px;" title="image" src="http://www.cplotts.com/wp-content/uploads/2009/10/image_thumb1.png" border="0" alt="image" width="540" height="388" /></a></p>
<p>If you click on the magnifying glass, drag it on top of a Windows Forms control, and release … the wfSpy properties window will then come up.</p>
<p><a href="http://www.cplotts.com/wp-content/uploads/2009/10/image3.png"><img style="display: inline; border-width: 0px;" title="image" src="http://www.cplotts.com/wp-content/uploads/2009/10/image_thumb3.png" border="0" alt="image" width="540" height="388" /></a></p>
<p>The wfSpy properties window shows all the properties on the control that you just selected … and not only can you view them … but you can also modify them (at runtime) as well!</p>
<p>The second notable change that we added was synchronizing the tree view (on the wfSpy’s main window) such that the control you selected … is the active ‘window’ selected.</p>
<p>This is extremely useful in the case where you have controls that are hiding other controls … and there is no way to select those hidden (or covered) controls with the crosshairs. In this case, you use the crosshairs to select the control you <em>can select</em>, and then you close the properties window and use the tree view to select the control <em>you want</em>. I would often turn the Visible property of a control on and off … to help me navigate through the tree of controls.</p>
<p>When utilizing the tree view synchronization feature … make sure you have a refreshed version of the current controls in the tree view … by clicking the ‘Refresh’ button on wfSpy’s main window. Otherwise, the synchronization logic might not be able to find the control (in the tree view) you selected.</p>
<p>So, without further adieu … <a href="http://www.cplotts.com/wp-content/uploads/2009/10/wfSpy.zip">here</a> is the source code.</p>
<p>Hope it helps!</p>
<p>p.s.</p>
<p>Leave a comment if it does help you … I always enjoy hearing that my efforts have actually paid dividends. <img src='http://www.cplotts.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.cplotts.com%2F2009%2F10%2F28%2Fan-ode-to-wfspy%2F&amp;title=An%20Ode%20to%20wfSpy" id="wpa2a_20">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.cplotts.com/2009/10/28/an-ode-to-wfspy/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
	</channel>
</rss>

