<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>S h o r t   S t o r i e s</title>
	<atom:link href="http://corengen.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://corengen.wordpress.com</link>
	<description>// Tales from software development</description>
	<lastBuildDate>Sun, 08 Jan 2012 20:25:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='corengen.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>S h o r t   S t o r i e s</title>
		<link>http://corengen.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://corengen.wordpress.com/osd.xml" title="S h o r t   S t o r i e s" />
	<atom:link rel='hub' href='http://corengen.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Web Service Mocking</title>
		<link>http://corengen.wordpress.com/2011/12/14/web-service-mocking/</link>
		<comments>http://corengen.wordpress.com/2011/12/14/web-service-mocking/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 19:00:03 +0000</pubDate>
		<dc:creator>Sea Monkey</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://corengen.wordpress.com/?p=729</guid>
		<description><![CDATA[I&#8217;ve just finished writing an interface for our medical information system that calls a customer&#8217;s web service for patient data. The web service isn&#8217;t yet available to use but, as it&#8217;s fairly simple, I created some test stubs that could be used to simulate the calls to the web service although they were actually in-process [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=corengen.wordpress.com&amp;blog=11798831&amp;post=729&amp;subd=corengen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just finished writing an interface for our medical information system that calls a customer&#8217;s web service for patient data. The web service isn&#8217;t yet available to use but, as it&#8217;s fairly simple, I created some test stubs that could be used to simulate the calls to the web service although they were actually in-process calls rather than a mocked web service.</p>
<p>Having finished the initial development I started testing and realised that, while useful during development,  my test stubs didn&#8217;t provide a useful testing environment. I considered writing a simple web service to mimic the customer&#8217;s but after a quick web search for web service mocking tools decided to give <a href="http://www.soapui.org/" target="_blank">soapUI</a> a try, not least because it&#8217;s available as a free open-source version.</p>
<p>I was sceptical of one reviewer&#8217;s claim that a mocked web service could be configured and running within a few minutes but was surprised to find that this is true. All I did was run soapUI, load the WSDL for the customer&#8217;s web service, and start the mock service.</p>
<p>To have the mock service return data you need to specify a response for each method called but soapUI provides an XML template for the response that makes it quick and easy to do this. There are several options to vary the response according to the method&#8217;s arguments.</p>
<p>Highly recommended.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/corengen.wordpress.com/729/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/corengen.wordpress.com/729/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/corengen.wordpress.com/729/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/corengen.wordpress.com/729/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/corengen.wordpress.com/729/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/corengen.wordpress.com/729/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/corengen.wordpress.com/729/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/corengen.wordpress.com/729/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/corengen.wordpress.com/729/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/corengen.wordpress.com/729/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/corengen.wordpress.com/729/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/corengen.wordpress.com/729/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/corengen.wordpress.com/729/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/corengen.wordpress.com/729/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=corengen.wordpress.com&amp;blog=11798831&amp;post=729&amp;subd=corengen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://corengen.wordpress.com/2011/12/14/web-service-mocking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e4ab34d9165a2404632fa519429786e6?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Sea Monkey</media:title>
		</media:content>
	</item>
		<item>
		<title>Downstream impact</title>
		<link>http://corengen.wordpress.com/2011/12/12/downstream-impact/</link>
		<comments>http://corengen.wordpress.com/2011/12/12/downstream-impact/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 19:00:22 +0000</pubDate>
		<dc:creator>Sea Monkey</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://corengen.wordpress.com/?p=726</guid>
		<description><![CDATA[It&#8217;s a well documented fact that the longer an issue goes unresolved during the development of a software product, the greater the impact is downstream. In the real world it&#8217;s sometimes necessary to accept that a known problem will not be resolved until later due to, for example, resourcing constraints. Sometimes we have to accept [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=corengen.wordpress.com&amp;blog=11798831&amp;post=726&amp;subd=corengen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s a well documented fact that the longer an issue goes unresolved during the development of a software product, the greater the impact is downstream. In the real world it&#8217;s sometimes necessary to accept that a known problem will not be resolved until later due to, for example, resourcing constraints. Sometimes we have to accept this and work around it as best we can. Last week an interesting example occurred that demonstrated why we shouldn&#8217;t allow this to happen if at all possible.</p>
<p>This particular project has been running for almost two years but the particular interface that I&#8217;m responsible for was &#8216;code complete&#8217; in July of this year. During some extended testing with large volumes of input data (around 18,000 HL7 messages) I noticed that a small number of messages were missing an identifier that the interface expects. In this implementation, the OBR-2 field of an ORU R01 message specifies the unique laboratory identifier for the test result.</p>
<p>No problems with the interface were found but the missing OBR-2 problem was reported to the customer&#8217;s developer responsible for the HL7 message feed. After several email exchanges it emerged that the IT Department Manager would not make anyone available to investigate the problem because the project was deemed to be a low priority as far as he was concerned. Perhaps this was understandable as the project didn&#8217;t have a &#8216;go-live&#8217; date scheduled at the time but I still considered it a poor decision. At the very least, a few hours spent on determining the cause would have indicated what the cause was and how much effort would be required to fix it.</p>
<p>As far as I was concerned, the interface itself was finished and no further testing would be done until the missing OBR-2 problem was fixed prior to the first &#8216;dry-run&#8217; of the &#8216;go-live&#8217; process.</p>
<p>In November a project plan was written that scheduled the first dry-run for early December. This meant that the missing OBR-2 problem had to be resolved by then. Last week a member of the customer&#8217;s IT team looked at the problem and identified the cause within 20 minutes. It was not a bug but a deliberate design decision. The OBR-2 field in this particular laboratory&#8217;s data feed contains the requestor&#8217;s request id rather than the laboratory&#8217;s test identifier but if the test is unsolicited then it&#8217;s blank. The &#8216;fix&#8217; agreed with the customer was to place the laboratory&#8217;s test identifier in the OBR-3 field and for the interface to use the OBR-2 value if available otherwise the OBR-3 value would be used.</p>
<p>This meant that the interface source code had to be updated and this in turn meant a new release build, installer, testing, deployment, etc.</p>
<p>So, even though I thought I was code complete at the end of July and that there was one small outstanding issue for the customer to resolve, here I was four and a half months later making code changes and going through another release cycle.</p>
<p>And all of this could have been avoided if the customer had allowed one of its developers to work on the problem for 20 minutes back in July.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/corengen.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/corengen.wordpress.com/726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/corengen.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/corengen.wordpress.com/726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/corengen.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/corengen.wordpress.com/726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/corengen.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/corengen.wordpress.com/726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/corengen.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/corengen.wordpress.com/726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/corengen.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/corengen.wordpress.com/726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/corengen.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/corengen.wordpress.com/726/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=corengen.wordpress.com&amp;blog=11798831&amp;post=726&amp;subd=corengen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://corengen.wordpress.com/2011/12/12/downstream-impact/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e4ab34d9165a2404632fa519429786e6?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Sea Monkey</media:title>
		</media:content>
	</item>
		<item>
		<title>Marco Simoncelli 1987-2011</title>
		<link>http://corengen.wordpress.com/2011/10/25/marco-simoncelli-1987-2011/</link>
		<comments>http://corengen.wordpress.com/2011/10/25/marco-simoncelli-1987-2011/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 19:00:18 +0000</pubDate>
		<dc:creator>Sea Monkey</dc:creator>
				<category><![CDATA[Comment]]></category>

		<guid isPermaLink="false">http://corengen.wordpress.com/?p=702</guid>
		<description><![CDATA[Marco Simoncelli, MotoGP rider, died at 16:56 local time on Sunday 23 October 2011 in Sepang, Malaysia, following a crash on lap 2 of the Malaysian Grand Prix. At times like this we look for meaning in what has happened, to learn, and to improve safety in the sport. But, there&#8217;s little, if anything, that can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=corengen.wordpress.com&amp;blog=11798831&amp;post=702&amp;subd=corengen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-703" title="simoncelli" src="http://corengen.files.wordpress.com/2011/10/simoncelli.jpg?w=700" alt=""   /><em>Marco Simoncelli, MotoGP rider, died at 16:56 local time on Sunday 23 October 2011 in Sepang, Malaysia, following a crash on lap 2 of the Malaysian Grand Prix.</em></p>
<p>At times like this we look for meaning in what has happened, to learn, and to improve safety in the sport. But, there&#8217;s little, if anything, that can be learned from Simoncelli&#8217;s death. This is not a &#8216;Senna moment&#8217; for MotoGP. Senna&#8217;s death highlighted the fact that there were problems with the cars and the tracks that could be quickly and easily improved and they were. By contrast, Simoncelli&#8217;s death comes at a time when the bikes and tracks, and the helmets, gloves, boots, and leathers, are safer than ever before.</p>
<p>It&#8217;s difficult to accept that there isn&#8217;t a reason, some underlying cause, a rider error, or an equipment failure, that can explain what happened. Simoncelli&#8217;s death came as the result of a loss of control followed by a collision with other riders. The fact that this fatality occurred at one of the most modern and safe circuits underlines that this type of incident cannot be totally eliminated from the sport. The raw truth is that even in this day and age motorsport is dangerous and potentially lethal and, sooner or later, riders will die.</p>
<p>Any such death is a tragedy but Simoncelli&#8217;s is a particularly bitter blow. A likeable, straightforward guy who was his own man on and off the track, on and off camera. His performances at the start of this year&#8217;s season were a little erratic but his talent, enthusiasm, and will to win couldn&#8217;t be questioned. He was the epitome of the adage that a fast rider can learn to stop crashing but a slow rider can&#8217;t learn to be fast. His most recent results, a third place finish at Brno, a string of fourth places, and a second place at Phillip Island, proved that he was learning quickly. It always takes a lot of talent to put a bike on pole position and Simoncelli did it twice this year beating world champions like Casey Stoner, Dani Pedrosa, and Jorge Lorenzo in the process.</p>
<p>For the past few years MotoGP has been dominated by &#8216;the aliens&#8217; &#8211; the elite handful of riders who are able to ride the current 800cc MotoGP bikes to the limit. This year only Simoncelli has been a regular threat to the aliens and at times has left some of them looking somewhat second rate. This is especially impressive considering that the aliens are all on full factory spec bikes in factory teams while Simoncelli is in a private team albeit on a factory bike and with support from Honda.</p>
<p>Honda&#8217;s problem at the moment is that they have too many riders in the factory team (three instead of the usual two) but it still offered Simoncelli a place in the factory team for 2012. Honda obviously saw a promising future for Simoncelli and wanted to bring him into the factory team despite already having a surplus of first rate riders. He turned Honda&#8217;s offer down to stay with the Gresini team for one more year but Honda agreed to continue providing a factory bike and support for 2012. The progress that he&#8217;d made this year and the continued factory support meant that he was likely to be on the podium regularly from the start of the 2012 season. With a third and a second place already secured he must have been looking towards his first race win. He clearly had the talent to win races and most, if not all, followers of the sport saw him as a likely future MotoGP World Champion.</p>
<p>Like many others I became a Simoncelli fan while watching him in the 250 GP class. I predicted great things for him in his first season in MotoGP and while he definitely made an early impact it wasn&#8217;t clear until halfway through the 2010 season that he had made a successful switch to the premier class. It&#8217;s worth remembering that even champions of the 125 and 250 (now Moto2) GP classes sometimes fail to make the transition to the premier class as the machines, their performance, and the riding style required, are vastly different. I didn&#8217;t fully realise how much of a fan I&#8217;d become until I experienced very mixed loyalties when Simoncelli and Cal Crutchlow were battling for seventh place in the closing laps of of a recent race. I was willing Simoncelli on when I suddenly realised that I ought to be supporting Crutchlow, the British rider. After a few seconds of confusion, I went with my heart and continued to shout encouragement for Simoncelli at the television screen.</p>
<p>Simoncelli&#8217;s performances on the track this year have provided most of the season&#8217;s excitement. His riding has been tough and uncompromising and has delivered some fantastic battles that he usually won. His quick but rough edged style was slowly being honed into something quite sublime. With the current 800cc MotoGP bikes, races are won and lost in the corners and Simoncelli&#8217;s ability to carry speed through a corner placed him among the best of the current riders. Not only did he take places by riding into and through a corner faster than his rivals, despite the disadvantage of his weight and size, he sometimes did it by riding the long way around rather than up the inside. His refusal to accept defeat, for example in the closing laps of this years Japanese GP, resulted in some of the most dramatic racing of the past few years.</p>
<p>His performances off the track were often as entertaining. For example, the press conference at Estoril this year where he joked, &#8220;Okay&#8230; I will be arrested!&#8221; when Jorge Lorenzo made an unprompted complaint about Simoncelli&#8217;s riding style. Or, his comment to a magazine reporter regarding the riders who complained about his allegedly dangerous riding: &#8220;They are not hard men &#8211; they are girls&#8230;&#8221;</p>
<p>To paraphrase a comment one poster made in a motorsport forum in relation to Simoncelli&#8217;s death: we are all defined by the date we are born and the date we die; it&#8217;s what we do between those two dates is that matters. Or as Simoncelli himself put it, &#8220;You live more for five minutes going fast on a bike like that than other people do in all of their life.&#8221; Few doubt Simoncelli&#8217;s comment that he&#8217;d be racing motorbikes even if he wasn&#8217;t being paid to do so.</p>
<p>He was a breath of fresh air in MotoGP and it&#8217;s difficult to imagine the sport without him. It will be a pale and bland imitation of what it was when we he was with us. We should be thankful to have witnessed a talent and personality such as his in the sport, no matter how briefly.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/corengen.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/corengen.wordpress.com/702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/corengen.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/corengen.wordpress.com/702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/corengen.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/corengen.wordpress.com/702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/corengen.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/corengen.wordpress.com/702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/corengen.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/corengen.wordpress.com/702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/corengen.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/corengen.wordpress.com/702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/corengen.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/corengen.wordpress.com/702/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=corengen.wordpress.com&amp;blog=11798831&amp;post=702&amp;subd=corengen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://corengen.wordpress.com/2011/10/25/marco-simoncelli-1987-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e4ab34d9165a2404632fa519429786e6?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Sea Monkey</media:title>
		</media:content>

		<media:content url="http://corengen.files.wordpress.com/2011/10/simoncelli.jpg" medium="image">
			<media:title type="html">simoncelli</media:title>
		</media:content>
	</item>
		<item>
		<title>Recursat In Pace</title>
		<link>http://corengen.wordpress.com/2011/10/18/recursat-in-pace/</link>
		<comments>http://corengen.wordpress.com/2011/10/18/recursat-in-pace/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 19:00:39 +0000</pubDate>
		<dc:creator>Sea Monkey</dc:creator>
				<category><![CDATA[Comment]]></category>

		<guid isPermaLink="false">http://corengen.wordpress.com/?p=699</guid>
		<description><![CDATA[Dennis Ritchie has died. Although best known for his work at Bell Labs on the C language, I was always hugely impressed by the book he co-authored with Brian Kernighan: &#8220;The C Programming Language&#8221;. It&#8217;s the best example of concision and elegance I&#8217;ve encountered and it even has a joke (of sorts) &#8211; look up [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=corengen.wordpress.com&amp;blog=11798831&amp;post=699&amp;subd=corengen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Dennis Ritchie has died. Although best known for his work at Bell Labs on the C language, I was always hugely impressed by the book he co-authored with Brian Kernighan: &#8220;The C Programming Language&#8221;. It&#8217;s the best example of concision and elegance I&#8217;ve encountered and it even has a joke (of sorts) &#8211; look up &#8220;recursion&#8221; in the index of the 2nd edition and you&#8217;ll find it on page 269:</p>
<p>recursion  86, 139, 141, 182, 202, 269</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/corengen.wordpress.com/699/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/corengen.wordpress.com/699/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/corengen.wordpress.com/699/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/corengen.wordpress.com/699/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/corengen.wordpress.com/699/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/corengen.wordpress.com/699/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/corengen.wordpress.com/699/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/corengen.wordpress.com/699/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/corengen.wordpress.com/699/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/corengen.wordpress.com/699/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/corengen.wordpress.com/699/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/corengen.wordpress.com/699/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/corengen.wordpress.com/699/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/corengen.wordpress.com/699/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=corengen.wordpress.com&amp;blog=11798831&amp;post=699&amp;subd=corengen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://corengen.wordpress.com/2011/10/18/recursat-in-pace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e4ab34d9165a2404632fa519429786e6?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Sea Monkey</media:title>
		</media:content>
	</item>
		<item>
		<title>Removing the Internet Explorer 8 search box</title>
		<link>http://corengen.wordpress.com/2011/10/11/removing-the-internet-explorer-8-search-box/</link>
		<comments>http://corengen.wordpress.com/2011/10/11/removing-the-internet-explorer-8-search-box/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 19:00:56 +0000</pubDate>
		<dc:creator>Sea Monkey</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://corengen.wordpress.com/?p=696</guid>
		<description><![CDATA[After ten minutes of trying everything I could think of to remove the search box shown to the right of the address bar in Internet Explorer 8 (and 7) I googled for a solution. It turns out that the search box can only be hidden by adding a registry setting &#8211; unbelievable! You need to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=corengen.wordpress.com&amp;blog=11798831&amp;post=696&amp;subd=corengen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After ten minutes of trying everything I could think of to remove the search box shown to the right of the address bar in Internet Explorer 8 (and 7) I googled for a solution. It turns out that the search box can only be hidden by adding a registry setting &#8211; unbelievable!</p>
<p>You need to add a DWORD setting called NoSearchBox with a value of 1 under the following key:</p>
<p>HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Infodelivery\Restrictions</p>
<p>More info here:</p>
<p><a href="http://www.vistax64.com/tutorials/68167-internet-explorer-search-box-add-remove.html" target="_blank">http://www.vistax64.com/tutorials/68167-internet-explorer-search-box-add-remove.html</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/corengen.wordpress.com/696/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/corengen.wordpress.com/696/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/corengen.wordpress.com/696/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/corengen.wordpress.com/696/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/corengen.wordpress.com/696/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/corengen.wordpress.com/696/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/corengen.wordpress.com/696/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/corengen.wordpress.com/696/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/corengen.wordpress.com/696/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/corengen.wordpress.com/696/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/corengen.wordpress.com/696/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/corengen.wordpress.com/696/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/corengen.wordpress.com/696/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/corengen.wordpress.com/696/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=corengen.wordpress.com&amp;blog=11798831&amp;post=696&amp;subd=corengen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://corengen.wordpress.com/2011/10/11/removing-the-internet-explorer-8-search-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e4ab34d9165a2404632fa519429786e6?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Sea Monkey</media:title>
		</media:content>
	</item>
		<item>
		<title>The primary reference could not be resolved</title>
		<link>http://corengen.wordpress.com/2011/09/27/the-primary-reference-could-not-be-resolved/</link>
		<comments>http://corengen.wordpress.com/2011/09/27/the-primary-reference-could-not-be-resolved/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 19:00:30 +0000</pubDate>
		<dc:creator>Sea Monkey</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://corengen.wordpress.com/?p=692</guid>
		<description><![CDATA[Last week one of my colleagues checked out the project that we&#8217;re working on and found that it wouldn&#8217;t build on her machine. This seemed rather odd as the project could be built successfully on my machine and on the build server. This is a Visual Studio 2010 solution with four projects that targets the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=corengen.wordpress.com&amp;blog=11798831&amp;post=692&amp;subd=corengen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last week one of my colleagues checked out the project that we&#8217;re working on and found that it wouldn&#8217;t build on her machine. This seemed rather odd as the project could be built successfully on my machine and on the build server.</p>
<p>This is a Visual Studio 2010 solution with four projects that targets the .NET 2.0 Framework. One of the projects references a common assembly called Vitality.Common.Data.dll containing routines to access MySQL databases.</p>
<p>When she tried to build the solution, one of the projects failed to build and the single error message indicated that namespace specified in a using statement and implemented in one of the other projects, which was referenced, was not found. This was very puzzling as there was no indication that the referenced project was failing to build.</p>
<p>At this point I was ignoring the warning messages and just concentrating on the error message. After a few minutes of unsuccessfull investigation I looked at the warning messages which, initially, seemed to make the problem even more puzzling:</p>
<blockquote><p>The primary reference &#8220;Vitality.Common.Data&#8221; could not be resolved because it has an indirect dependency on the .NET Framework assembly &#8220;Accessibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&#8221; which has a higher version &#8220;4.0.0.0&#8243; than the version &#8220;2.0.0.0&#8243; in the current target framework.</p></blockquote>
<p>As the solution targets the .NET 2.0 Framework and references a .NET 2.0 assembly, why did the warning messages reference .NET 4.0 assemblies ?</p>
<p>But the main puzzle was why this solution could be successfully built on other machines. Using the most basic diagnostic approach, what was different on this machine ?</p>
<p>I vaguely remembered that my colleague had recently been working on a .NET 4.0 project that used the MySQL .NET Connector and guessed that she had installed the .msi package for this. Neither my machine nor the build server had the MySQL .NET Connector installed and relied on the solution including a copy of the referenced MySQL assembly. Could that be the difference ?</p>
<p>Well, an install of the MySQL .NET Connector would almost certainly have put the assemblies in the GAC and this particular version, 6.3.6, includes assemblies built for both the .NET 2.0 and .NET 4.0 Frameworks. Could this be why references to .NET 4.0 assemblies were appearing in the warning messages ?</p>
<p>Suddenly, it made sense&#8230;</p>
<p>Project A references Project B<br />
Project B references Vitality.Common.Data.dll<br />
Vitality.Common.Data.dll has a dependency on MySql.Data.dll</p>
<p>There is no direct reference in the solution to MySql.Data.dll so when it&#8217;s built this dependency has to be resolved by probing for the assembly. This is where the difference between the machines becomes significant as it appears that the GAC is searched for the dependency, MySql.Data.dll, first and then, if not found, the directory where the directly referenced assembly, Vitality.Common.Data.dll, resides.</p>
<p>So, on both my machine and the build server, the copy of MySql.Data.dll that is in the same directory as the referenced assembly, Vitality.Common.Data.dll is used but on my colleague&#8217;s machine it is the copy in the GAC that is used.</p>
<p>The simple solution was to add a reference to the project that referenced Vitality.Common.Data.dll for the copy of the MySql.Data.dll assembly in the same directory as the Vitality.Common.Data.dll assembly. Once this was done the solution could be successfully built.</p>
<p>The only remaining question is why the dependency resolution process selected  the .NET 4.0 version of the MySql.Data.dll assembly from the GAC rather than the .NET 2.0 version&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/corengen.wordpress.com/692/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/corengen.wordpress.com/692/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/corengen.wordpress.com/692/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/corengen.wordpress.com/692/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/corengen.wordpress.com/692/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/corengen.wordpress.com/692/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/corengen.wordpress.com/692/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/corengen.wordpress.com/692/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/corengen.wordpress.com/692/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/corengen.wordpress.com/692/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/corengen.wordpress.com/692/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/corengen.wordpress.com/692/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/corengen.wordpress.com/692/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/corengen.wordpress.com/692/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=corengen.wordpress.com&amp;blog=11798831&amp;post=692&amp;subd=corengen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://corengen.wordpress.com/2011/09/27/the-primary-reference-could-not-be-resolved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e4ab34d9165a2404632fa519429786e6?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Sea Monkey</media:title>
		</media:content>
	</item>
		<item>
		<title>Abstract class or interface ?</title>
		<link>http://corengen.wordpress.com/2011/09/20/abstract-class-or-interface/</link>
		<comments>http://corengen.wordpress.com/2011/09/20/abstract-class-or-interface/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 19:00:08 +0000</pubDate>
		<dc:creator>Sea Monkey</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://corengen.wordpress.com/?p=665</guid>
		<description><![CDATA[While adding some new functionality to a tracing and logging library I couldn&#8217;t decide whether I needed a new interface or a new abstract base class to implement a new feature. I started with an abstract base class but changed my mind and used an interface instead. Then I changed my mind again when I realised that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=corengen.wordpress.com&amp;blog=11798831&amp;post=665&amp;subd=corengen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While adding some new functionality to a tracing and logging library I couldn&#8217;t decide whether I needed a new interface or a new abstract base class to implement a new feature.</p>
<p>I started with an abstract base class but changed my mind and used an interface instead. Then I changed my mind again when I realised that I needed the class constructors to be part of the contract.</p>
<p>There are times when it&#8217;s obvious that an interface definition is needed and similarly there are times when it&#8217;s obvious that a base class is the solution. But in situations where it&#8217;s not obvious, for example the implementation of internal code in an assembly, then deciding whether constructors are part of the implementaion contract may guide you to the answer.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/corengen.wordpress.com/665/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/corengen.wordpress.com/665/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/corengen.wordpress.com/665/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/corengen.wordpress.com/665/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/corengen.wordpress.com/665/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/corengen.wordpress.com/665/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/corengen.wordpress.com/665/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/corengen.wordpress.com/665/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/corengen.wordpress.com/665/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/corengen.wordpress.com/665/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/corengen.wordpress.com/665/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/corengen.wordpress.com/665/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/corengen.wordpress.com/665/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/corengen.wordpress.com/665/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=corengen.wordpress.com&amp;blog=11798831&amp;post=665&amp;subd=corengen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://corengen.wordpress.com/2011/09/20/abstract-class-or-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e4ab34d9165a2404632fa519429786e6?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Sea Monkey</media:title>
		</media:content>
	</item>
		<item>
		<title>Different return types from Activator.CreateInstance</title>
		<link>http://corengen.wordpress.com/2011/09/16/different-return-types-from-activator-createinstance/</link>
		<comments>http://corengen.wordpress.com/2011/09/16/different-return-types-from-activator-createinstance/#comments</comments>
		<pubDate>Fri, 16 Sep 2011 19:00:14 +0000</pubDate>
		<dc:creator>Sea Monkey</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://corengen.wordpress.com/?p=667</guid>
		<description><![CDATA[While writing some IOC infrastructure code a few days ago I stumbled across the fact that Activator.CreateInstance() sometimes returns an ObjectHandle rather than an Object. Perhaps I&#8217;ve led a sheltered life but until now I&#8217;ve only needed to use overloads of Activator.CreateInstance() that return an Object. This just needs casting in order to use it. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=corengen.wordpress.com&amp;blog=11798831&amp;post=667&amp;subd=corengen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While writing some <a href="http://en.wikipedia.org/wiki/Inversion_of_control" target="_blank">IOC</a> infrastructure code a few days ago I stumbled across the fact that Activator.CreateInstance() sometimes returns an ObjectHandle rather than an Object.</p>
<p>Perhaps I&#8217;ve led a sheltered life but until now I&#8217;ve only needed to use overloads of Activator.CreateInstance() that return an Object. This just needs casting in order to use it.</p>
<p>I&#8217;m not sure why this difference exists but it&#8217;s easy enough to deal with as the ObjectHandle class implements an UnWrap() method that returns the Object that the handle references.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/corengen.wordpress.com/667/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/corengen.wordpress.com/667/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/corengen.wordpress.com/667/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/corengen.wordpress.com/667/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/corengen.wordpress.com/667/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/corengen.wordpress.com/667/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/corengen.wordpress.com/667/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/corengen.wordpress.com/667/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/corengen.wordpress.com/667/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/corengen.wordpress.com/667/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/corengen.wordpress.com/667/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/corengen.wordpress.com/667/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/corengen.wordpress.com/667/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/corengen.wordpress.com/667/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=corengen.wordpress.com&amp;blog=11798831&amp;post=667&amp;subd=corengen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://corengen.wordpress.com/2011/09/16/different-return-types-from-activator-createinstance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e4ab34d9165a2404632fa519429786e6?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Sea Monkey</media:title>
		</media:content>
	</item>
		<item>
		<title>Different number of stack frames between Debug and Release builds</title>
		<link>http://corengen.wordpress.com/2011/09/14/different-number-of-stack-frames-between-debug-and-release-builds/</link>
		<comments>http://corengen.wordpress.com/2011/09/14/different-number-of-stack-frames-between-debug-and-release-builds/#comments</comments>
		<pubDate>Wed, 14 Sep 2011 19:00:37 +0000</pubDate>
		<dc:creator>Sea Monkey</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://corengen.wordpress.com/?p=669</guid>
		<description><![CDATA[I&#8217;ve recently been making some enhancements to a tracing and logging library that was written about four years ago. The tracing functionality uses the StackTrace class to get the stack frame of the caller and then logs information about the caller. The updated code passed its unit tests and I created a new releae build [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=corengen.wordpress.com&amp;blog=11798831&amp;post=669&amp;subd=corengen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently been making some enhancements to a tracing and logging library that was written about four years ago. The tracing functionality uses the StackTrace class to get the stack frame of the caller and then logs information about the caller.</p>
<p>The updated code passed its unit tests and I created a new releae build but a few days later I found that the code repeatedly threw a NullReferenceException when called from the Main() method of a Windows console application.</p>
<p>After a few hours of debugging and head scratching the cause eventually became clear. The problem only occured with Release mode compiled code and initially I thought the problem might be due to code optimisation. After ruling this out by disabling optimisation in Release mode compiles, I realised that it was the Debug Info setting that is accessed using the Advanced button on the Build tab of the project properties page. The problem didn&#8217;t occur when this was set to <em>Full</em> (as used in Debug mode builds) but did occur when it was set to <em>PDB Only</em> (used in Release mode builds) or <em>None</em>.</p>
<p>Using the debugger to step through the tracing code it became clear that when Debug Info is set to <em>Full</em> there is an extra frame on the stack between the stack frame for Main() and the tracing code&#8217;s constructor. Presumably, the <em>Full</em> setting causes some interception code to be generated by the C# compiler that results in the additional stack frame. So, in Release mode builds the tracing code was stepping too far up the call stack and when the caller was the program entry point this caused a NullReferenceException.</p>
<p>I considered updating the tracing code to examine the stack frames and determine how far up the call stack it needed to step but was concerned that this might add a significant performance overhead when tracing is active. Instead, I decided to define conditional compilation constants to indicate which Debug Info setting is active. The stack frame constant is then defined conditionally. The tracing code needs to step nine frames up the call stack when Debug Info is set to <em>Full</em> or eight when set to <em>PDB Only</em> or <em>None</em>:</p>
<pre>#if DEBUGINFO_FULL
        private const int BaseStackFrameOffset = 9;
#endif
#if DEBUGINFO_PDBONLY || DEBUGINFO_NONE
        private const int BaseStackFrameOffset = 8;
#endif</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/corengen.wordpress.com/669/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/corengen.wordpress.com/669/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/corengen.wordpress.com/669/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/corengen.wordpress.com/669/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/corengen.wordpress.com/669/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/corengen.wordpress.com/669/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/corengen.wordpress.com/669/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/corengen.wordpress.com/669/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/corengen.wordpress.com/669/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/corengen.wordpress.com/669/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/corengen.wordpress.com/669/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/corengen.wordpress.com/669/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/corengen.wordpress.com/669/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/corengen.wordpress.com/669/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=corengen.wordpress.com&amp;blog=11798831&amp;post=669&amp;subd=corengen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://corengen.wordpress.com/2011/09/14/different-number-of-stack-frames-between-debug-and-release-builds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e4ab34d9165a2404632fa519429786e6?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Sea Monkey</media:title>
		</media:content>
	</item>
		<item>
		<title>Problems with xsd.exe</title>
		<link>http://corengen.wordpress.com/2011/09/12/problems-with-xsd-exe/</link>
		<comments>http://corengen.wordpress.com/2011/09/12/problems-with-xsd-exe/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 19:00:19 +0000</pubDate>
		<dc:creator>Sea Monkey</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://corengen.wordpress.com/?p=676</guid>
		<description><![CDATA[I&#8217;ve been using Microsoft&#8217;s XsdInfer.exe and XsdObjectGen.exe utilities since they were released seven or eight years ago without any problems but about a year ago I needed to generate C# class source code for a complex set of schemas and found that the task was beyond XsdObjectGen. The xsd.exe utility that ships with Visual Studio [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=corengen.wordpress.com&amp;blog=11798831&amp;post=676&amp;subd=corengen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using Microsoft&#8217;s XsdInfer.exe and XsdObjectGen.exe utilities since they were released seven or eight years ago without any problems but about a year ago I needed to generate C# class source code for a complex set of schemas and found that the task was beyond XsdObjectGen.</p>
<p>The xsd.exe utility that ships with Visual Studio and the Windows Platform SDK supercedes XsdInfer.exe and XsdObjectGen.exe but while I&#8217;ve used xsd.exe to generate custom datasets over the past six years I&#8217;ve never used it to generate XmlSerializable data classes. So, it was a relief to find that xsd.exe successfully the C# classes  I needed and that these performed without any problems.</p>
<p>Over the past few weeks I&#8217;ve been updating our build processes and this seemed to be a good opportunity to phase out XsdInfer.exe and XsdObjectGen.exe in favour of an up to date distibution of xsd.exe.</p>
<p>In hindsight I shouln&#8217;t have wasted the time and effort because I just encountered one bug after another. Do a search for xsd.exe at Microsoft&#8217;s Knowledgebase web page:</p>
<p><a href="http://support.microsoft.com/search/default.aspx?query=xsd.exe">http://support.microsoft.com/search/default.aspx?query=xsd.exe</a></p>
<p>and you&#8217;ll get a list of 21 bugs and problems.</p>
<p>Even when I wasn&#8217;t encountering bugs, the data classes it generated appear to be a step backwards. For example, repeating elements are represented as arrays without an IEnumerable implementation so that the foreach() syntax I&#8217;ve happily been using for years can no longer be used.</p>
<p>Amongst the behaviour that I&#8217;d classify as odd if not an outright bug is that when using inferring an XSD from an XML file, an attribute on an element causes it to be treated as a repeating element. If the intention is for the element to be a single item then this requires that the element is referenced as the first element type in an element type array rather than just the element type, e.g.</p>
<pre>ConfigurationFile configFile = myClass.ConfigurationFile;</pre>
<p> <br />
must be replaced with</p>
<pre>ConfigurationFile configFile = myClass.ConfigurationFile[0];</pre>
<p> <br />
which implies that there might be multiple ConfigurationFile elements.</p>
<p>This can be fixed by editing the XSD created by xsd.exe but this is not a viable solution in our automated build processes.</p>
<p>A related problem that definitely is a bug is that in some circumstances the serialization attributes in the class code generated by xsd.exe do not correctly describe the types being serialized. This shows up as a serialization failure at runtime with the following error messages:</p>
<pre>Unable to generate a temporary class (result=1).
error CS0030: Cannot convert type 'xxxxxxxx[]' to 'xxxxxxxx'
error CS0029: Cannot implicitly convert type 'xxxxxxxx' to 'xxxxxxxx[]'</pre>
<p> <br />
Examination of the class code shows that the the relevant XmlArrayAttribute has been specified with typeof(xxxxxxxx) when it should be typeof(xxxxxxxx[]). There&#8217;s a good blog post on this problem <a href="http://satov.blogspot.com/2006/12/xsdexe-generated-classes-causing.html" target="_blank">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/corengen.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/corengen.wordpress.com/676/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/corengen.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/corengen.wordpress.com/676/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/corengen.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/corengen.wordpress.com/676/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/corengen.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/corengen.wordpress.com/676/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/corengen.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/corengen.wordpress.com/676/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/corengen.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/corengen.wordpress.com/676/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/corengen.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/corengen.wordpress.com/676/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=corengen.wordpress.com&amp;blog=11798831&amp;post=676&amp;subd=corengen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://corengen.wordpress.com/2011/09/12/problems-with-xsd-exe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e4ab34d9165a2404632fa519429786e6?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Sea Monkey</media:title>
		</media:content>
	</item>
	</channel>
</rss>
