<?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>thinking in geek &#187; .net</title>
	<atom:link href="http://joshrobb.com/blog/category/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://joshrobb.com/blog</link>
	<description>tagline's are so web2.0</description>
	<lastBuildDate>Fri, 11 Mar 2011 07:17:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>ASP.NET == Usability disaster?</title>
		<link>http://joshrobb.com/blog/2008/09/29/aspnet-usability-disaster/</link>
		<comments>http://joshrobb.com/blog/2008/09/29/aspnet-usability-disaster/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 09:24:08 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[web architecture]]></category>

		<guid isPermaLink="false">http://joshrobb.com/blog/?p=18</guid>
		<description><![CDATA[[This has been in the queue for a long time - over 12 months - codebetter just tipped me over the edge!] Peter Van Dijck asks: Iâ€™ve only worked twice with companies using .NET for web interfaces, and in both cases the UI was a disaster and the usability problems guaranteed lots of consulting hours.. [...]]]></description>
			<content:encoded><![CDATA[<p>[This has been in the queue for a long time - over 12 months - codebetter just tipped me over the edge!]</p>
<p><a href="http://poorbuthappy.com/ease/archives/2007/05/01/3626/3626">Peter Van Dijck asks</a>:</p>
<blockquote><p>Iâ€™ve only worked twice with companies using .NET for web interfaces, and in both cases the UI was a disaster and the usability problems guaranteed lots of consulting hours.. Why is that? Or was that a fluke? (2 cases is hardly proof of anything) I know itâ€™s possible to make usable and elegant web UI with any technology, but does .NET somehow encourage bad UI?</p></blockquote>
<p>This is a great question and in my opinion &#8211; the answer is yes. (AssumingÂ that Peter really means WebForms.) Â <img style="float:right" title="spike pit of death" src="http://www.hotkey.net.au/~marshalle/booby/pit.gif" alt="spike pit of death" width="350" height="321" /></p>
<p>This is demonstrated in so many small ways by framework defaults which are totally brain dead (__doPostBack anyone?). Rather than lead dev&#8217;s into the <a href="http://blogs.msdn.com/brada/archive/2003/10/02/50420.aspx">pit of success</a> &#8211; the framework leads devs to the spiky elephant trap of death.Â </p>
<p>Â <br />
What&#8217;s that &#8211; an example? How about the &lt;customErrors&gt; defaults. When an error occurs during processing an ASP.NET request &#8211; the <strong>default</strong>Â behaviorÂ of a new web.config is to redirect the user to another URL. This is what a new web.config looks like in VS2k5.Â </p>
<p>Â Â  Â  Â  Â &lt;customErrors mode=&#8221;RemoteOnly&#8221; defaultRedirect=&#8221;GenericErrorPage.htm&#8221;&gt;</p>
<p>Â Â  Â  Â  Â  Â  Â &lt;error statusCode=&#8221;403&#8243; redirect=&#8221;NoAccess.htm&#8221; /&gt;</p>
<p>Â Â  Â  Â  Â  Â  Â &lt;error statusCode=&#8221;404&#8243; redirect=&#8221;FileNotFound.htm&#8221; /&gt;</p>
<p>Â Â  Â  Â  Â &lt;/customErrors&gt;</p>
<div>This is really brain deadÂ behavior! Let&#8217;s count the ways:Â </div>
<div>1. There&#8217;s no way to change the HTTP status code from a html page. (E.g. &#8211; should be 404, 500 etc). This is just flat out bad &#8211; status codes are important for lots of reasons.</div>
<div>2. The <strong><em>effing</em></strong> URL will change. This makes it difficult to correct typing errors or retry a request in case of a server error (500).Â </div>
<div>3. Those files don&#8217;t even exist! You can get a 404 when the real error is a 500 because the file that your getting redirected to don&#8217;t <strong>effing</strong> exist!Â </div>
<div>This just happened to me &#8211; I was just wondering if there is a port of the monorailÂ SmartGridComponent to ASP.NET MVC. I do a Google search and get a <a href="http://devlicio.us/blogs/billy_mccafferty/archive/2008/08/10/41786.aspx">likely looking result forÂ Billy McCafferty&#8217;s blog</a>. I click on the link and I get the following page:Â </div>
<div>
<blockquote>
<div><strong>Oops something went wrong!</strong></div>
<div>Either the site is offline or an unhandled error occurred. We apologize and have logged the error. Please try your request again or if you know who your site administrator is let them know too.</div>
</blockquote>
</div>
<p>Â </p>
<p>The URL in the browsers address bar is:Â </p>
<blockquote><p>http://devlicio.us/error.htm?aspxerrorpath=/themes/blogs/default/post.aspx</p></blockquote>
<div>HOW the F$%K do I try my request again?</div>
<div>If I&#8217;ve opened this result in a new tab (which is my habbit) I&#8217;m screwed! There is no back button, refresh (F5 or whatever) just reloads the error page and will <em>never</em>Â show me the correct page.</div>
<div>If I just clicked the link &#8211; the back button takes me back to my google search where I can click on the link again &#8211; refresh is still borked.Â </div>
<p>Another example? Linkbutton? Anyone who&#8217;s tried to open a link in a new tab/window and got a blank window with a URL like:Â javascript:__doPostBack(&#8216;ctl00$Masthead1$LocaleManagement$ctl00$ctl05&#8242;,&#8221;) &#8211; knows the pain I&#8217;m talking about.Â </p>
<p>Go on &#8211; right now &#8211; go try and open a MSDN library page in different language in a new tab. (It&#8217;s the little menu up the top right where it says (e.g.): United States &#8211; English).Â </p>
<p>In my apps &#8211; I fix this by disabling customErrors and writing new error handling code which both maintains the url and returns the correct HTTP statuses &#8211; but this is code which I should not have to write. This is code which all web servers/apps need to implement correctly &#8211; it should be automatic. We shouldn&#8217;t have to write custom code to get a HTTP/404 returned when an appÂ encounters a missing file!</p>
]]></content:encoded>
			<wfw:commentRss>http://joshrobb.com/blog/2008/09/29/aspnet-usability-disaster/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The only way is up</title>
		<link>http://joshrobb.com/blog/2008/06/13/the-only-way-is-up/</link>
		<comments>http://joshrobb.com/blog/2008/06/13/the-only-way-is-up/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 07:23:50 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[.net]]></category>

		<guid isPermaLink="false">http://joshrobb.com/blog/2008/06/13/the-only-way-is-up/</guid>
		<description><![CDATA[From anÂ altnetÂ list discussion about Team Build (part of TFS):Â Â  On Thu, Jun 12, 2008 at 7:35 PM, David Kean wrote:Â Â  Team Build is more than just MSBuild, it includes build management (retention, CI, drop management, etc). The next version will be even more powerful and based on Windows Workflow.Â Â  Â  On Fri, Jun 13, 2008 [...]]]></description>
			<content:encoded><![CDATA[<p>From anÂ <a href="http://groups.yahoo.com/group/altdotnet">altnet</a>Â list discussion about Team Build (part of TFS):Â Â <br />
<blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px">On Thu, Jun 12, 2008 at 7:35 PM, David Kean wrote:Â Â </p></blockquote>
<blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px"><p>Team Build is more than just MSBuild, it includes build management (retention, CI, drop management, etc). The next version will be even more powerful and based on Windows Workflow.Â Â </p></blockquote>
<p>Â <br />
<blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px">
<blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px">On Fri, Jun 13, 2008 at 2:43 AM, Ayende Rahien wrote:Â </p></blockquote>
<blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px"><p>And here I thought that the only way to go was up.Â </p></blockquote>
<blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px"><p>Â </p></blockquote>
</blockquote>
<p>Pure gold.Â </p>
]]></content:encoded>
			<wfw:commentRss>http://joshrobb.com/blog/2008/06/13/the-only-way-is-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enterprise plaforms &#8211; teaching new dogs old tricks</title>
		<link>http://joshrobb.com/blog/2007/11/19/enterprise-plaforms-teaching-new-dogs-old-tricks/</link>
		<comments>http://joshrobb.com/blog/2007/11/19/enterprise-plaforms-teaching-new-dogs-old-tricks/#comments</comments>
		<pubDate>Mon, 19 Nov 2007 23:23:19 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[web architecture]]></category>

		<guid isPermaLink="false">http://joshrobb.com/blog/2007/11/19/enterprise-plaforms-teaching-new-dogs-old-tricks/</guid>
		<description><![CDATA[Oren is talking about building a substrate for an enterprise platform. This has been something I&#8217;ve wanted to do since I first got my hands on c# and the rest of the .net framework in 2001. I&#8217;ve never done it because it always seemed that a one size fits all solution would be unworkable. At [...]]]></description>
			<content:encoded><![CDATA[<p>Oren is talking about building a <a href="http://ayende.com/Blog/archive/2007/11/17/A-vision-of-enterprise-platform.aspx">substrate for an enterprise platform</a>. This has been something I&#8217;ve wanted to do since I first got my hands on c# and the rest of the .net framework in 2001. I&#8217;ve never done it because it always seemed that a one size fits all solution would be unworkable.</p>
<p>At the time &#8211; the best web architecture I knew of was the <a href="http://en.wikipedia.org/wiki/ArsDigita_Corporation">ArsDigita</a> <a href="http://en.wikipedia.org/wiki/ArsDigita_Community_System">Community System</a> (still available and maintained as <a href="http://openacs.org/">OpenACS</a>). What Oren is describing sounds similar in many ways.</p>
<p>The ACS architecture is based on the days when Oracle and TCL were good options for building web based systems&#8230;. but the underlying design is still very very good (e.g. it was the first place I every saw the Party pattern). They were focused on designing good data models and separating concerns.</p>
<p>They have the following available in their <a href="http://openacs.org/doc/current/kernel-doc.html">kernel</a>:</p>
<ul>
<li><a href="http://openacs.org/doc/current/parties.html">Parties</a>, Users and <a href="http://openacs.org/doc/current/groups-design.html">(nestable) groups</a></li>
<li><a href="http://openacs.org/doc/current/permissions-tediously-explained.html">A permissions system</a> which supports per &#8220;<a href="http://openacs.org/doc/current/objects.html">object</a>&#8221; (think row) permissions.</li>
<li>A <a href="http://openacs.org/doc/current/apm-design.html">package manager</a> which allows you to install (and remove) modules of functionality into an existing system (including schema changes, new routes etc). e.g. adding a e-commerce, blogging or threaded discussion module is a matter of clicking in a web ui.</li>
<li><a href="http://openacs.org/doc/current/tutorial-schedule-procs.html">Scheduled tasks</a></li>
</ul>
<p>This thing was and is pretty scalable (it runs the <a href="http://photo.net">photo.net</a> community).</p>
<p>It&#8217;s over 10 years old still a source of good ideas. I recommend taking a poke around their documentation and seeing what you can learn.</p>
<p>(I remember reading once that Philip Greenspun &#8211; the original ACS designer was asked by Microsoft to build a new version while the .net framework 1.0 was in development as a showpiece. For some reason he didn&#8217;t but I always felt that it was a shame this never happened).</p>
]]></content:encoded>
			<wfw:commentRss>http://joshrobb.com/blog/2007/11/19/enterprise-plaforms-teaching-new-dogs-old-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>String Manipulation DSL&#8217;s</title>
		<link>http://joshrobb.com/blog/2007/09/05/string-manipulation-dsls/</link>
		<comments>http://joshrobb.com/blog/2007/09/05/string-manipulation-dsls/#comments</comments>
		<pubDate>Wed, 05 Sep 2007 22:54:41 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[asp.net]]></category>

		<guid isPermaLink="false">http://joshrobb.com/blog/2007/09/05/string-manipulation-dsls/</guid>
		<description><![CDATA[Mats comments on my previous post: &#8220;But I guess what Iâ€™m saying is that the code for inserting that string using just strings may look even worse when you come back to look at it a week laterâ€¦&#8221; If your thinking that I&#8217;m talking about code like: StringBuilder sb = new StringBuilder(); sb.Append(&#8220;xxx &#8211; yyy [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.matshelander.com/wordpress/">Mats</a> comments on my <a href="http://joshrobb.com/blog/2007/09/04/webforms-hurt-me-good/">previous post</a>:</p>
<p style="margin-left: 40px">&#8220;But I guess what Iâ€™m saying is that the code for inserting that string using just strings may look even worse when you come back to look at it a week laterâ€¦&#8221;</p>
<p>If your thinking that I&#8217;m talking about code like:</p>
<p style="margin-left: 40px">StringBuilder sb = new StringBuilder();<br />
sb.Append(&#8220;xxx &#8211; yyy [somevar] zzz&#8221;);<br />
Response.Write(sb.ToString().Replace(&#8220;[somevar]&#8220;,&#8221;somevalue&#8221;));</p>
<p>Then I&#8217;d agree. This is a maintenance nightmare. Solving this is a well known &#8220;pattern&#8221;. Use a domain specific language (DSL). In this case &#8211; we&#8217;d use a template language. Imagine a hypothetical template DSL:</p>
<p style="margin-left: 40px">TemplateContext context = new TemplateContext(&#8220;somevar&#8221;,&#8221;somevalue&#8221;);<br />
Response.Write(Template.Eval(&#8220;xxx &#8211; yyy &lt;%=somevar %&gt; zzz&#8221;,context));</p>
<p>It is possible to write this in a way that is maintainable and still readable a week later. <a href="http://codebetter.com/blogs/scott.bellware/">Scott Bellware&#8217;s</a> <a href="http://joshrobb.com/blog/2007/08/02/soc-in-webforms/">comment</a> still sums this up for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://joshrobb.com/blog/2007/09/05/string-manipulation-dsls/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Server.Transfer does not run ASP.NET pipeline</title>
		<link>http://joshrobb.com/blog/2007/07/17/servertransfer-does-not-run-aspnet-pipeline/</link>
		<comments>http://joshrobb.com/blog/2007/07/17/servertransfer-does-not-run-aspnet-pipeline/#comments</comments>
		<pubDate>Tue, 17 Jul 2007 17:10:53 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[asp.net]]></category>

		<guid isPermaLink="false">http://joshrobb.com/blog/2007/07/17/servertransfer-does-not-run-aspnet-pipeline/</guid>
		<description><![CDATA[Things I&#8217;ve learnt today: One. What I&#8217;ve learnt: If you use the convenient (if old school) Server.Transfer method to render a different page to a client then you need to be aware that ASP.NET pipeline events1 will not run. You know &#8211; BeginRequest, AuthenticateRequest &#8211; unimportant things like that. Basically &#8211; nothing that happens in [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Things I&#8217;ve learnt today: </strong> One.</p>
<p><strong>What I&#8217;ve learnt: </strong>If you use the convenient (if old school) Server.Transfer method to render a different page to a client then you need to be aware that ASP.NET pipeline events<sup><a href="http://joshrobb.com/blog/2007/07/17/servertransfer-does-not-run-aspnet-pipeline/#footnote_0_27" id="identifier_0_27" class="footnote-link footnote-identifier-link" title="http://msdn2.microsoft.com/en-us/library/ms178473.aspx">1</a></sup> will <strong>not</strong> run. You know &#8211; BeginRequest, AuthenticateRequest &#8211; unimportant things like that.</p>
<p>Basically &#8211; nothing that happens in Global.asax, HttpModules etc&#8230; will happen for this page.</p>
<p>This caused a rather embarrassing scenario for me.</p>
<p>If you requested a page which did not exist &#8211; then I Server.Transfer&#8217;ed you to a 404.aspx page.</p>
<p>At the time this seemed like good <abbr title="Separation of Concerns">SOC</abbr> &#8211; I can have a whole page which takes care of setting the correct HTTP status code, taking care of common misses etc. without issuing a redirect &#8211; which would mean you lost the url in your browser. (Something that asp.net does way to much for my tastes &#8211; but thats a whole &#8216;nother post).</p>
<p>Problem is that &#8211; the HttpModule I have which hooks up the correct &#8220;skin&#8221; for that customer based on the host header didn&#8217;t run &#8211; which meant that the user got the &#8220;default&#8221; skin &#8211; in this case another customers. <img src='http://joshrobb.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  Anyway &#8211; it&#8217;s all fixed now &#8211; but I&#8217;ve had to duplicate the code to hook up the correct skin in two places. Which is not so hot.</p>
<p>ASP.NET is so cool. I want to have it&#8217;s children. NOT. Seriously &#8211; who wrote this &#8211; what were they thinking?</p>
<blockquote><p>Oh &#8211; we have a special case &#8211; well &#8211; we&#8217;ll re-implement some aspects of the whole fricking pipeline again to take care of this!</p></blockquote>
<p>ARRRGGG!!!!</p>
<ol class="footnotes"><li id="footnote_0_27" class="footnote">http://msdn2.microsoft.com/en-us/library/ms178473.aspx</li></ol>]]></content:encoded>
			<wfw:commentRss>http://joshrobb.com/blog/2007/07/17/servertransfer-does-not-run-aspnet-pipeline/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You know youâ€™re having a bad day when&#8230;</title>
		<link>http://joshrobb.com/blog/2007/06/28/you-know-you%e2%80%99re-having-a-bad-day-when/</link>
		<comments>http://joshrobb.com/blog/2007/06/28/you-know-you%e2%80%99re-having-a-bad-day-when/#comments</comments>
		<pubDate>Thu, 28 Jun 2007 17:02:14 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[iis]]></category>

		<guid isPermaLink="false">http://joshrobb.com/blog/2007/06/28/you-know-you%e2%80%99re-having-a-bad-day-when/</guid>
		<description><![CDATA[You walk into the office and get told that you need to drop everything you were going to be working on because there&#8217;s a recurring problem on the production servers. For the last few days we&#8217;ve been experiencing a 100% CPU utilization on the w3wp.exe (the asp.net worker) process. Killing it off will fix the [...]]]></description>
			<content:encoded><![CDATA[<p>You walk into the office and get told that you need to drop everything you were going to be working on because there&#8217;s a recurring problem on the production servers. For the last few days we&#8217;ve been experiencing a 100% CPU utilization on the w3wp.exe (the asp.net worker) process. Killing it off will fix the problem temporarily &#8211; but it will start up again sooner or later. Time to start production debugging!</p>
<ol>
<li>Install the <a href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx">Debugging Tools for Windows</a> and thank the good Lord you&#8217;ve been reading <a href="http://blogs.msdn.com/tess/">Tess&#8217;s blog</a>.</li>
<li>Create a &#8220;hang&#8221; dump of the process.
<p style="text-align: justify"><span style="font-family: Courier">&gt; adplus -hang -p 1680<br />
</span></li>
<li> Open the dump in windbg.exe
<p style="text-align: justify"><span style="font-family: Courier">&gt;windbg.exe -z Hang_Mode__Date_06-28-2007__Time_11-21-2020<br />
</span></li>
<li>Load <a href="http://msdn2.microsoft.com/en-us/library/ms404370(VS.80).aspx">sos.dll</a> &#8211; the debug helper for the CLR.
<p style="text-align: justify"><span style="font-family: Courier">&gt; .load C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\sos.dll<br />
</span></li>
<li>Checkout what&#8217;s happening in the CLR thread pool.
<p><span style="font-family: Courier">0:000&gt; !threadpool<br />
CPU utilization 100%<br />
Worker Thread: Total: 3 Running: 2 Idle: 1 MaxLimit: 200 MinLimit: 2<br />
Work Request in Queue: 0<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Number of Timers: 9<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Completion Port Thread:Total: 2 Free: 1 MaxFree: 4 CurrentLimit: 2 MaxLimit: 200 MinLimit: 2<br />
</span></li>
<li>There are two CLR threads running. Wonder what they&#8217;re doing? Are they GC&#8217;ing or in user code? Let&#8217;s take a look at what&#8217;s happening with the OS threads.
<p><span style="font-family: Courier">0:000&gt; !threads<br />
ThreadCount: 8<br />
UnstartedThread: 0<br />
BackgroundThread: 8<br />
PendingThread: 0<br />
DeadThread: 0<br />
Hosted Runtime: no<br />
PreEmptive GC Alloc Lock<br />
ID OSID ThreadOBJ State GC Context Domain Count APT Exception<br />
13 1 90c 000dc6e8 1808220 Enabled 02b64538:02b65458 000d9710 0 Ukn (Threadpool Worker)<br />
17 2 fdc 000e2fc8 b220 Enabled 00000000:00000000 000d9710 0 MTA (Finalizer)<br />
18 3 38c 000f7798 80a220 Enabled 00000000:00000000 000d9710 0 MTA (Threadpool Completion Port)<br />
19 4 84c 000fa800 1220 Enabled 00000000:00000000 000d9710 0 Ukn<br />
11 5 cd0 00116b30 880a220 Enabled 00000000:00000000 000d9710 0 MTA (Threadpool Completion Port)<br />
<strong>21 6 e94 0ebd6bc8 180b220 Disabled 00000000:00000000 000fb1a0 1 MTA (Threadpool Worker)<br />
22 8 b70 0ebde1a8 180b220 Disabled 00000000:00000000 000fb1a0 1 MTA (Threadpool Worker)</strong><br />
23 7 e14 0ec0a378 880b220 Enabled 00000000:00000000 000d9710 0 MTA (Threadpool Completion Port)<br />
</span></li>
<li>There&#8217;s two threads running user code there &#8211; are they the ones that are pegging the CPU? Let&#8217;s see.
<p><span style="font-family: Courier">0:000&gt; !runaway<br />
User Mode Time<br />
Thread Time<br />
<strong>21:e94 0 days 0:19:50.296<br />
22:b70 0 days 0:15:38.625</strong><br />
13:90c 0 days 0:00:07.062<br />
15:934 0 days 0:00:00.156<br />
16:a38 0 days 0:00:00.140<br />
3:bec 0 days 0:00:00.062<br />
5:538 0 days 0:00:00.046<br />
0:2e0 0 days 0:00:00.046<br />
28:6f0 0 days 0:00:00.000<br />
27:a3c 0 days 0:00:00.000<br />
26:530 0 days 0:00:00.000<br />
25:358 0 days 0:00:00.000<br />
24:b8c 0 days 0:00:00.000<br />
23:e14 0 days 0:00:00.000<br />
20:9e8 0 days 0:00:00.000<br />
19:84c 0 days 0:00:00.000<br />
18:38c 0 days 0:00:00.000<br />
17:fdc 0 days 0:00:00.000<br />
14:5d4 0 days 0:00:00.000<br />
12:ab8 0 days 0:00:00.000<br />
11:cd0 0 days 0:00:00.000<br />
10:f1c 0 days 0:00:00.000<br />
9:ac4 0 days 0:00:00.000<br />
8:a40 0 days 0:00:00.000<br />
7:a24 0 days 0:00:00.000<br />
6:c84 0 days 0:00:00.000<br />
4:f94 0 days 0:00:00.000<br />
2:bb0 0 days 0:00:00.000<br />
1:270 0 days 0:00:00.000<br />
</span></li>
<li>Yep &#8211; the two CLR threads are chewing all the CPU. Let&#8217;s switch our thread context to the first one. (21).
<p><span style="font-family: Courier">0:006&gt; ~21 s<br />
eax=026bcd88 ebx=026bcd01 ecx=026bcd88 edx=02702a44 esi=026bcd88 edi=026bf064<br />
eip=0ee0709e esp=0eeff1ec ebp=026bcd88 iopl=0 nv up ei ng nz na pe cy<br />
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000287<br />
Demo!Models.CMSPage.IsSubPage(Models.CMSPage)+0&#215;56:<br />
0ee0709e 0fb6db movzx ebx,bl<br />
</span></li>
<li>Let&#8217;s take a look at what managed objects are reachable from the current stack.
<p><span style="font-family: Courier">0:021&gt; !dso<br />
OS Thread Id: 0xe94 (21)<br />
ESP/REG Object Name<br />
<strong>eax 026bcd88 Models.CMSPage<br />
ecx 026bcd88 Models.CMSPage<br />
esi 026bcd88 Models.CMSPage<br />
edi 026bf064 Models.CMSPage<br />
ebp 026bcd88 Models.CMSPage<br />
0eeff1f8 026bcd88 Models.CMSPage<br />
</strong>0eeff1fc 026bf064 Models.CMSPage<br />
0eeff208 06529858 System.String &lt;ul id=&#8221;menu-level{0}&#8221;&gt;<br />
0eeff238 026cd1cc System.Object[] (Models.CMSPage[])<br />
0eeff240 790d6584 System.String<br />
0eeff244 026b906c ASP.skins_demo_master_master<br />
0eeff284 026b906c ASP.skins_demo_master_master<br />
0eeff28c 026bdea4 System.Text.StringBuilder<br />
0eeff29c 026cd1cc System.Object[] (Models.CMSPage[])<br />
0eeff2a0 026bdea4 System.Text.StringBuilder<br />
0eeff2a4 026cd1cc System.Object[] (Models.CMSPage[])<br />
0eeff2a8 026bcd88 Models.CMSPage<br />
0eeff2b8 026b906c ASP.skins_demo_master_master<br />
0eeff2bc 026bdd2c System.Web.UI.HtmlControls.HtmlLink<br />
0eeff2cc 026df978 System.Object<br />
0eeff2d0 024af58c System.String class<br />
0eeff2dc 0651f798 System.String screen.css<br />
0eeff2f8 026b906c ASP.skins_demo_master_master<br />
0eeff310 024a793c System.EventArgs<br />
0eeff33c 026b906c ASP.skins_demo_master_master<br />
0eeff350 026b4bdc ASP.default_aspx<br />
0eeff374 790d6584 System.String<br />
0eeff37c 026afcf4 System.Web.HttpContext<br />
0eeff380 026b4bdc ASP.default_aspx<br />
0eeff514 026b4bdc ASP.default_aspx<br />
0eeff528 026b4bdc ASP.default_aspx<br />
0eeff558 02464340 System.Globalization.CultureInfo<br />
0eeff55c 02464110 System.Globalization.CultureInfo<br />
0eeff560 025beff0 System.Threading.Thread<br />
0eeff564 026b4bdc ASP.default_aspx<br />
0eeff59c 026afcf4 System.Web.HttpContext<br />
0eeff5a0 026b4bdc ASP.default_aspx<br />
0eeff5bc 026afcf4 System.Web.HttpContext<br />
0eeff5c0 025d1084 System.Web.HttpApplication+CallHandlerExecutionStep<br />
0eeff5f8 025d1084 System.Web.HttpApplication+CallHandlerExecutionStep<br />
0eeff5fc 025beeb0 ASP.global_asax<br />
0eeff62c 025beeb0 ASP.global_asax<br />
0eeff630 026affb4 System.Web.HttpApplication+ThreadContext<br />
0eeff634 025e54a0 System.Web.AspNetSynchronizationContext<br />
0eeff63c 025beeb0 ASP.global_asax<br />
0eeff668 026aff98 System.Web.HttpAsyncResult<br />
0eeff690 026afcf4 System.Web.HttpContext<br />
0eeff694 026af6ac System.Web.Hosting.ISAPIWorkerRequestInProcForIIS6<br />
0eeff698 02477fb0 System.Web.HttpRuntime<br />
0eeff6e0 0247b8e4 System.Web.Caching.CacheSingle<br />
0eeff700 0248e4a4 System.Web.Hosting.ISAPIRuntime<br />
</span></li>
<li>Himmm.. we have the same instance (026bcd88) of that CMSPage object floating around in a bunch of places. I wonder if we have some bad data in the database. This class has a parent/child relationship with itself. Could it be causing an infinite loop?
<p><span style="font-family: Courier">0:021&gt; !do 026bcd88<br />
Name: Models.CMSPage<br />
MethodTable: 0e941234<br />
EEClass: 0244cc60<br />
Size: 92(0x5c) bytes<br />
(C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\5bf6c3da\19d72350\assembly\dl3\36150507\00d93296_9ca7c701\Demo.DLL)<br />
Fields:<br />
MT Field Offset Type VT Attr Value Name<br />
0e942118 4000140 40 &#8230;sionFactoryHolder 0 static 024c4e34 holder<br />
791036b0 4000147 4 &#8230;ections.ArrayList 0 instance 026bcde4 __validators<br />
79113dfc 4000148 8 &#8230;tions.IDictionary 0 instance 00000000 __failedProperties<br />
79124228 4000149 c System.Object[] 0 instance 00000000 _errorMessages<br />
790fed1c 40000f7 40 System.Int32 0 instance 102 _id<br />
790fa3e0 40000f8 18 System.String 0 instance 026bc668 _name<br />
790fa3e0 40000f9 1c System.String 0 instance 00000000 _url<br />
790fa3e0 40000fa 20 System.String 0 instance 026bc6a0 _title<br />
790fa3e0 40000fb 24 System.String 0 instance 026bc768 _content<br />
790fa3e0 40000fc 28 System.String 0 instance 026bc6c8 _heading<br />
790fa3e0 40000fd 2c System.String 0 instance 026bc6e4 _metaDescription<br />
790fa3e0 40000fe 30 System.String 0 instance 026bc71c _metaKeyWords<br />
0e941174 40000ff 44 System.Int32 0 instance 2 _status<br />
791059c0 4000100 10 System.Double 0 instance 1.000000 _displayOrder<br />
<strong>0e941234 4000101 34 Models.CMSPage 0 instance 026bcd88 _parent<br />
</strong>7910e274 4000102 38 &#8230;Collections.IList 0 instance 026bcef0 _children<br />
79105ef0 4000103 48 System.DateTime 1 instance 026bcdd0 _dateUpdatedAt<br />
79105ef0 4000104 50 System.DateTime 1 instance 026bcdd8 _dateCreatedAt<br />
0e94337c 4000105 3c Models.Site 0 instance 026b8e30 _Site<br />
</span></li>
<li>11. Yep &#8211; check that &#8211; the _parent field of instance 026bcd88 is pointing at itself (026bcd88). Log into the database and manually patch up the data. Next job &#8211; write some more defensive code around how that works.</li>
</ol>
<p>Well &#8211; I hope you enjoyed that. Production debugging is always fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://joshrobb.com/blog/2007/06/28/you-know-you%e2%80%99re-having-a-bad-day-when/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WPF Dependency Properties as Acquisition</title>
		<link>http://joshrobb.com/blog/2007/05/08/wpf-dependency-properties-as-acquisition/</link>
		<comments>http://joshrobb.com/blog/2007/05/08/wpf-dependency-properties-as-acquisition/#comments</comments>
		<pubDate>Tue, 08 May 2007 10:24:11 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://joshrobb.com/blog/2007/05/08/wpf-dependency-properties-as-acquisition/</guid>
		<description><![CDATA[I read a sample chapter from Adam Nathan&#8216;s WPF book &#8211; Windows Presentation Foundation Unleashed &#8211; a few weeks ago. (This book has been getting some mad props from around the net recently). The chapter covers the new concepts in WPF which is super because if you can understand the important ideas (what Ayende calls [...]]]></description>
			<content:encoded><![CDATA[<p>I read a <a href="http://www.sneath.org/tim/wpf_nathan.pdf">sample chapter</a> from <a href="http://blogs.msdn.com/adam_nathan/">Adam Nathan</a>&#8216;s WPF book &#8211; <a href="http://www.amazon.com/Windows-Presentation-Foundation-Unleashed-WPF/dp/0672328917/">Windows Presentation Foundation Unleashed</a> &#8211; a few weeks ago. (This book has been getting some <a href="http://blogs.msdn.com/adam_nathan/archive/2007/04/30/petzold-vs-nathan.aspx">mad props</a> from around the net recently).</p>
<p>The chapter covers the new concepts in WPF which is super because if you can understand the important ideas (<a href="http://www.ayende.com/Blog/archive/2007/03/06/How-are-you-keeping-up-with-this-deluge-of-technology.aspx">what Ayende calls the model</a>) which a technology is built on then you can ignore the details until you need them. </p>
<p><em>Quick sample chapter review:</em> I&#8217;ve not spent any time at all with WPF and thought I should at least take a little peak under the kimono. In this one chapter &#8211; I feel that I got enough background to understand the high level architecture of WPF/XAML. Strongly recommended. </p>
<p>In the discussion of Dependency Properties &#8211; I was struck by their similarity to what&#8217;s known in computer science as <a href="http://www.ccs.neu.edu/home/lorenz/papers/oopsla96/">environmental acquisition</a>. This is the concept that objects inherit attributes based not on their type hierarchy but on their containment hierarchy. </p>
<p>I&#8217;m curious about why Microsoft decided to overload the (already massively overloaded) word &#8220;Dependency&#8221; rather than using an already common term which describes exactly what is going on. It&#8217;s kind of like adding a BinaryTree implementation to System.Collections and calling it FastSet. </p>
<p>Personally &#8211; I think that AcquisitionProperty or AcquiredProperty is much clearer &#8211; even if you don&#8217;t know what acquisition is &#8211; once you do &#8211; you have a clear term to describe exactly what&#8217;s going on. I realise that Dependancy Properties provide more than just Acquisition &#8211; but really &#8211; &#8220;Dependancy&#8221;? </p>
<p>I first came across the concept of Aquisition when I was working with Zope back in 2001. <a href="http://www.zope.org/Members/jim/">Jim Fulton</a> did a presentation at the Python conference that year called <a href="http://www.zope.org/Members/jim/Info/IPC8/AcquisitionAlgebra/index.html">Acquisition Algebra</a> which contained some of the background to the concept. <a href="http://blog.jonudell.net/">John Udell</a> also wrote a <a href="http://207.22.26.166/bytecols/2001-06-13.html">great article</a> on this powerful feature. </p>
]]></content:encoded>
			<wfw:commentRss>http://joshrobb.com/blog/2007/05/08/wpf-dependency-properties-as-acquisition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

