<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7861049761445932376</id><updated>2024-08-28T11:41:25.044-07:00</updated><category term=".NET 3.5"/><category term="ClickOnce"/><category term="Installer"/><category term="Nant"/><category term="TDD"/><category term="CVS"/><category term="Chrome"/><category term="CruiseControl.NET"/><category term="Deployment"/><category term="MSBuild"/><category term="Threading"/><category term="TortoiseCVS"/><category term="xUnit"/><title type='text'>Code Monkey King</title><subtitle type='html'>The name comes from Code Monkey and Monkey King (孫悟空). It aptly describes the volume of code I write, the homage to the Chinese side of my family, and the mischievous/curious nature of the Monkey King.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>34</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-3577052185065912661</id><published>2011-01-14T17:56:00.001-08:00</published><updated>2011-05-09T10:53:53.208-07:00</updated><title type='text'>Rhino ESB for Dummies</title><content type='html'>&lt;p&gt;This will document my “dummy” experience. I’ve been using &lt;a href=&quot;http://www.nservicebus.com/&quot;&gt;NServiceBus&lt;/a&gt; for a while, but the license model changed out from under us so we’ve been investigating alternatives. A fellow in the office pointed us to &lt;a href=&quot;https://github.com/ayende/rhino-esb&quot;&gt;Rhino ESB&lt;/a&gt; (he had pointed us to NServiceBus earlier).&lt;/p&gt;&lt;h2&gt;Immediate Impressions&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;SNAP – I need to get GIT running in the desktop (&lt;a href=&quot;http://git-scm.com/download&quot;&gt;git v1.7.3.5&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;Brought up a new command window and typed: &lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;git clone &lt;/span&gt;&lt;a title=&quot;https://github.com/ayende/rhino-esb.git&quot; href=&quot;https://github.com/ayende/rhino-esb.git&quot;&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;https://github.com/ayende/rhino-esb.git&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Had to figure out how to use &lt;a href=&quot;https://github.com/JamesKovacs/psake/wiki/How-do-I-run-psake%3F&quot;&gt;psake&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;pre&gt;C:\Source\external\rhino-esb&amp;gt;powershell&lt;br /&gt;Windows PowerShell&lt;br /&gt;Copyright (C) 2009 Microsoft Corporation. All rights reserved.&lt;br /&gt;&lt;br /&gt;PS C:\Source\external\rhino-esb&amp;gt; .\psake.ps1 .\default.ps1&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style=&quot;font-family:Georgia;&quot;&gt;So, that appears to be all there is to it. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;&lt;span style=&quot;font-family:Georgia;&quot;&gt;Upsides/Downsides&lt;/span&gt;&lt;br /&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family:Georgia;&quot;&gt;We’ve been making extensive use of &lt;a href=&quot;http://code.google.com/p/autofac/&quot;&gt;Autofac&lt;/a&gt; as our container and Rhino has a predisposition for &lt;a href=&quot;http://stw.castleproject.org/Windsor.MainPage.ashx&quot;&gt;Castle Windsor&lt;/a&gt;. We’ll just use Windsor in the handlers for now and leave other areas (i.e. ASP.NET MVC 2) to use Autofac. I’m told that a container agnostic version of Rhino ESB is in the works.&lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family:Georgia;&quot;&gt;Testing with NServiceBus was pretty straightforward as it provided mocks of our handlers and also setup the expect portions. I’m told that with Rhino Mocks we don’t need to worry about that and we just test our handler’s independently from the ‘service bus’.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family:Georgia;&quot;&gt;No more need to adorn our message classes with IMessage.&lt;/span&gt; &lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family:Georgia;&quot;&gt;UPDATE&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;font-family:Georgia;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family:Georgia;&quot;&gt;I had to enter Set-ExecutionPolicy Unrestricted to run the psake script.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/3577052185065912661/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2011/01/rhino-esb-for-dummies.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/3577052185065912661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/3577052185065912661'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2011/01/rhino-esb-for-dummies.html' title='Rhino ESB for Dummies'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-8739214345047766111</id><published>2011-01-05T16:37:00.001-08:00</published><updated>2011-01-05T18:14:34.960-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET 3.5"/><category scheme="http://www.blogger.com/atom/ns#" term="TDD"/><category scheme="http://www.blogger.com/atom/ns#" term="xUnit"/><title type='text'>Separating Integration Tests from Unit Tests with xUnit</title><content type='html'>&lt;p&gt;How often do you find that you’ve written a very useful test that crosses a process boundary, or makes changes to another system (file system, database) which by definition of a Unit Test shouldn’t be tested as part of your code coverage, but its highly useful.&lt;/p&gt;  &lt;p&gt;Here are some attributes that you can use to mark up your (these are inspired by several other posts out there on the internet).&lt;/p&gt;  &lt;pre class=&quot;brush: csharp; gutter: false;&quot;&gt;public sealed class IntegrationFactAttribute : FactAttribute&lt;br /&gt;{&lt;br /&gt;   protected override IEnumerable&lt;itestcommand&gt; EnumerateTestCommands(IMethodInfo method)&lt;br /&gt;   {&lt;br /&gt;       var attrs = method.MethodInfo.GetCustomAttributes(typeof(IntegrationAttribute), true).Cast&lt;integrationattribute&gt;();&lt;br /&gt;&lt;br /&gt;       if (Skip == null &amp;amp;&amp;amp; attrs.Any(x =&amp;gt; x.ShouldRunTest))&lt;br /&gt;       {&lt;br /&gt;           return base.EnumerateTestCommands(method);&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       return new[] { new SkipCommand(method, method.Name, &quot;Integration method skipped&quot;) };&lt;br /&gt;   }&lt;br /&gt;}&lt;/integrationattribute&gt;&lt;/itestcommand&gt;&lt;/pre&gt;The abstract class below defines a simple Boolean property in which we can define the circumstances under which we want to execute the method.&lt;br /&gt;&lt;pre class=&quot;brush: csharp; gutter: false;&quot;&gt;public abstract class IntegrationAttribute : Attribute&lt;br /&gt;{&lt;br /&gt;   public abstract bool ShouldRunTest { get; }&lt;br /&gt;}&lt;/pre&gt;Below is an example class that tests to see if there is a debugger attached, and if so, it returns true for the ‘ShouldRunTest’ property. When this is evaluated in the EnumerateTestCommands in the IntegrationFactAttribute it will run the marked test method.&lt;pre class=&quot;brush: csharp; gutter: false;&quot;&gt;[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]&lt;br /&gt;public class WhenInDebuggerAttribute : IntegrationAttribute&lt;br /&gt;{&lt;br /&gt;   public override bool ShouldRunTest&lt;br /&gt;   {&lt;br /&gt;       get { return System.Diagnostics.Debugger.IsAttached; }&lt;br /&gt;   }&lt;br /&gt;}&lt;/pre&gt;Example using both attributes. This test which tests through to the database will only be run if it was executing inside of the debugger. If you are using Resharper or TestDriven.NET then you can execute the test while debugging but no longer need to worry need to be concerned that your continuous build environment will be testing code depends on a shared resource.&lt;br /&gt;&lt;pre class=&quot;brush: csharp; gutter: false;&quot;&gt;[IntegrationFact, WhenInDebugger]&lt;br /&gt;public void CheckLiveRepositoryOnClinicianByOrganizationID()&lt;br /&gt;{&lt;br /&gt;   const int idToMatch = 1;&lt;br /&gt;&lt;br /&gt;   // Create LS2 Repository&lt;br /&gt;   var repository = CreateRepository();&lt;br /&gt;&lt;br /&gt;   // Use a Specification to retrieve results&lt;br /&gt;   var clinicians = repository.Find(ClinicianSpecs.ByOrganizationID(idToMatch)).ToList();&lt;br /&gt;&lt;br /&gt;   // Assert valid&lt;br /&gt;   clinicians.Should().Not.Be.Null();&lt;br /&gt;}&lt;/pre&gt;Note that I’m using the &lt;a href=&quot;http://should.codeplex.com/&quot;&gt;Should Assertion Library&lt;/a&gt; instead of the Assert.NotNull(). If you’re interested in more behavior driven development then this library makes your assertions read well.&lt;p&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/8739214345047766111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2011/01/separating-integration-tests-from-unit.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/8739214345047766111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/8739214345047766111'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2011/01/separating-integration-tests-from-unit.html' title='Separating Integration Tests from Unit Tests with xUnit'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-9093985141408174580</id><published>2010-07-18T19:57:00.000-07:00</published><updated>2010-07-22T11:22:27.050-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CruiseControl.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="CVS"/><category scheme="http://www.blogger.com/atom/ns#" term="TortoiseCVS"/><title type='text'>CVS, CruiseControl.NET and mysterious errors</title><content type='html'>After many days of head scratching and trying to come up with the correct google phrase to find a solution to the infamous:&lt;br /&gt;&lt;blockquote&gt;cvs checkout: move away xxx; it is in the way&lt;/blockquote&gt;I finally determined the cause and was then able to identify a post with a solution:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.feyrer.de/NetBSD/bx/blosxom.cgi/nb_20050320_2045.html&quot;&gt;Switching CVS servers easily&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It turns out that this error has two likely causes:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;If you&#39;re on Windows then someone might have the same file named with different case. Our CVS server is hosted on a linux platform so that it is possible to store ThisFile.txt and THISFILE.TXT in the same directory. Upon cvs update, windows will try to overwrite the file and complain that the file is already there. This can be more evil if it was at the directory level!&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The second cause, and the one that I wasn&#39;t aware of, is that the value contained in the hidden CVS\Root file must be the same as the CVSROOT value of your client (or environment variable if your client is aware of the %CVSROOT% variable.)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Our problem was that we routinely use multiple clients to access CVS (command line, TortoiseCVS, WinCVS and finally CC.NET as well). Whenever I saw this problem, I would usually log in to the build server and delete the offending directory. That usually works. However, since we had a different CVSROOT value specified in the TortoiseCVS than the one in the CC.NET configuration file, it was possible that the value stored in CVS\Root would be different.&lt;br /&gt;&lt;br /&gt;The key is either to make sure that you&#39;re CVSROOT file is always the same one, or alternatively, if you suspect this is the issue, then check the CVS\Root file to make sure that it matches up to the one your client is using.&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#FF0000;&quot;&gt;UPDATE&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#FF0000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#FF0000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;After several attempts I was able to identify yet another cause for the &#39;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 0); font-size: 16px; &quot;&gt;cvs checkout: move away xxx; it is in the way&#39; message. Check to make sure that any &#39;Entries.log&#39; files were removed by your build scripts. In our case we use &lt;a href=&quot;http://nant.sourceforge.net/&quot;&gt;NAnt&lt;/a&gt; and we had a clean target which removed all *.log files and in addition we had specifically ignored the default excludes. The default excludes has a pattern to exclude the hidden CVS directory and any contents of that directory.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#FF0000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;font-size:130%;color:#000000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#FF0000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;font-size:130%;color:#000000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 16px;&quot;&gt;So to sum it up, just keep in mind that the single &#39;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large; color: rgb(255, 0, 0); &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 0); font-size: 16px; &quot;&gt;cvs checkout: move away xxx; it is in the way&#39; can occur for any of the following reasons:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;$CVSROOT (or %CVSROOT%) is different than the value found in the CVS/Root directory. This could also be an issue if you supply the -d {cvsroot} option to the cvs executable.&lt;/li&gt;&lt;li&gt;If your CVS server is located on a case sensitive O/S (Linux for example) and your client is on a case insensitive O/S (Windows), then make sure some has not committed a similarly named directory or file.&lt;/li&gt;&lt;li&gt;Check the Entries and Entries.log files in the hidden CVS directory to make sure that it matches what files are in the corresponding directory. If they don&#39;t then it&#39;s possible some other process has removed the Entries.log file!&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/9093985141408174580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2010/07/cvs-cruisecontrolnet-and-mysterious.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/9093985141408174580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/9093985141408174580'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2010/07/cvs-cruisecontrolnet-and-mysterious.html' title='CVS, CruiseControl.NET and mysterious errors'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-7743610375549811509</id><published>2010-04-29T16:55:00.001-07:00</published><updated>2010-04-29T16:55:31.001-07:00</updated><title type='text'>Netbook and Windows Anytime Upgrade</title><content type='html'>&lt;p&gt;I mentioned in a previous post that I struggled with how to access my creative juices while on vacation while not toting around an extra ten pounds of gear. I settled on a HP Mini 210, it&#39;s a little underpowered, but it weighs in around 3 pounds which isn&#39;t too bad as extra weight. It has 1 GB memory (nothing like my Dell Quad Core with 8GB!) and it is limited in disk space. I left my 500GB hard drive at home as I didn&#39;t want to cart that around as well. I&#39;ve got quite a bit of things on this laptop even so. &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Visual Studio 2010 &lt;/li&gt;    &lt;li&gt;SQL Server 2008 Express &lt;/li&gt;    &lt;li&gt;Mercurial plus all of the devs tools I could think of - WinMerge, e, nant... I did miss TestDriven.NET, so I&#39;ll have to figure how that works into writing code. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;After rushing to install everything I thought I&#39;d need I decided at 2.30 am (with a 4.45 wake up forthcoming!) to try an upgrade from Starter edition to Home Professional. Don&#39;t be fooled, it says that the upgrade will take 10 minutes or so, unless there are Windows Updates! Doh! I think I finished out with a workable system again more than an hour later! I recommend if you&#39;re going to do an Anytime Upgrade on your system to do it with time to spare. I was wondering if I had bricked my new system right before the trip! It all worked out and went smoothly, but not without some minutes of stress in the wee hours. &lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/7743610375549811509/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2010/04/netbook-and-windows-anytime-upgrade.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/7743610375549811509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/7743610375549811509'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2010/04/netbook-and-windows-anytime-upgrade.html' title='Netbook and Windows Anytime Upgrade'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-8724391581765607853</id><published>2010-04-29T16:53:00.001-07:00</published><updated>2010-04-29T16:53:32.794-07:00</updated><title type='text'>HG Walkabout</title><content type='html'>&lt;p&gt;Just prior to taking a three week vacation to Europe I splurged and purchased a Netbook (HP Mini 210-1032CL). I don&#39;t recommend doing this at the very last minute, but sometimes... &lt;/p&gt;  &lt;p&gt;I have a copy of O&#39;Reilly&#39;s Mercurial book and I spent time looking around for a digital copy of the book. I didn&#39;t find it on the &#39;net. I finally located it while I was sitting at the gate in SFO in the TortoiseHG docs directory *sweet*! &lt;/p&gt;  &lt;p&gt;I discovered that it was quite easy to use the great &#39;hg help&#39; command. I found out that first I need to remove the chaff from CVS (CVS artifacts.) I also was scratching my head for a bit trying to figure out how to ignore files that I did not want added to the repository. &lt;/p&gt;  &lt;p&gt;Directly from the hg help init: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font size=&quot;3&quot; face=&quot;Cordia New&quot;&gt;hg init [-e CMD] [--remotecmd CMD] [DEST] &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size=&quot;3&quot; face=&quot;Cordia New&quot;&gt;create a new repository in the given directory &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size=&quot;3&quot; face=&quot;Cordia New&quot;&gt;&amp;#160;&amp;#160;&amp;#160; Initialize a new repository in the given directory. If the given directory        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; does not exist, it will be created. &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size=&quot;3&quot; face=&quot;Cordia New&quot;&gt;&amp;#160;&amp;#160;&amp;#160; If no directory is given, the current directory is used. &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size=&quot;3&quot; face=&quot;Cordia New&quot;&gt;&amp;#160;&amp;#160;&amp;#160; It is possible to specify an &amp;quot;ssh://&amp;quot; URL as the destination. See &#39;hg help        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; urls&#39; for more information. &lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now that I had a repository built I knew that I needed to tell Mercurial what files were in it. I forged ahead and did a &#39;hg add&#39; only to discover that I&#39;d inadvertently added all of the CVS directories as well as the files that typically end up in our .cvsignore files. So that lead me to discover both &#39;hg remove&#39; and &#39;hg forget&#39;, all three commands are described below: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font size=&quot;3&quot; face=&quot;Cordia New&quot;&gt;hg add [OPTION]... [FILE]... &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size=&quot;3&quot; face=&quot;Cordia New&quot;&gt;add the specified files on the next commit &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size=&quot;3&quot; face=&quot;Cordia New&quot;&gt;&amp;#160;&amp;#160;&amp;#160; Schedule files to be version controlled and added to the repository. &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size=&quot;3&quot; face=&quot;Cordia New&quot;&gt;&amp;#160;&amp;#160;&amp;#160; The files will be added to the repository at the next commit. To undo an        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; add before that, see hg forget. &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size=&quot;3&quot; face=&quot;Cordia New&quot;&gt;&amp;#160;&amp;#160;&amp;#160; If no names are given, add all files to the repository.        &lt;br /&gt;&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font size=&quot;3&quot; face=&quot;Courier New&quot;&gt;hg remove [OPTION]... FILE... &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size=&quot;3&quot; face=&quot;Courier New&quot;&gt;aliases: rm &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size=&quot;3&quot; face=&quot;Courier New&quot;&gt;remove the specified files on the next commit &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size=&quot;3&quot; face=&quot;Courier New&quot;&gt;&amp;#160;&amp;#160;&amp;#160; Schedule the indicated files for removal from the repository. &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size=&quot;3&quot; face=&quot;Courier New&quot;&gt;&amp;#160;&amp;#160;&amp;#160; This only removes files from the current branch, not from the entire        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; project history. -A/--after can be used to remove only files that have         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; already been deleted, -f/--force can be used to force deletion, and -Af         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; can be used to remove files from the next revision without deleting them         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; from the working directory.         &lt;br /&gt;&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;hg forget [OPTION]... FILE... &lt;/p&gt;  &lt;p&gt;forget the specified files on the next commit &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; Mark the specified files so they will no longer be tracked after the next    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; commit. &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; This only removes files from the current branch, not from the entire    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; project history, and it does not delete them from the working directory. &lt;/p&gt;  &lt;p&gt;To undo a forget before the next commit, see hg add.    &lt;br /&gt;I think I&#39;ve figured out that there are multiple ways to save yourself with Mercurial. I thought I had to do a &#39;hg remove&#39; and a &#39;hg forget&#39;, but I believe that could have been avoided by supplying an option to the remove command - &#39;hg remove --force&#39; which says remove (and delete) file even if added or modified. &lt;/p&gt;  &lt;p&gt;Sidebar: I&#39;m flying at 573mph ground speed at 35000 feet somewhere over Lake Michigan right now. Yes I know in the first paragraph I said that I was sitting in the San Francisco airport at the gate, but I was interrupted when I had to get on the plane, a lunch/dinner and subsequent knap. My clock says its just after midnight in London, I&#39;m not ready to give into the sleep and change time zones just yet :) &lt;/p&gt;  &lt;p&gt;Using e-TextEditor now and you get the Mercurial icons in the Project viewer. Nice! &lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://lh6.ggpht.com/_ulEPJI66qaQ/S9ob9XyeLkI/AAAAAAAAC_A/4MCGJbrZjO8/s1600-h/snap2010042900292.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;snap-20100429-0029&quot; border=&quot;0&quot; alt=&quot;snap-20100429-0029&quot; src=&quot;http://lh3.ggpht.com/_ulEPJI66qaQ/S9ob-0ctZBI/AAAAAAAAC_E/DqYxf51Eodk/snap201004290029_thumb.png?imgmax=800&quot; width=&quot;162&quot; height=&quot;138&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/8724391581765607853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2010/04/hg-walkabout.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/8724391581765607853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/8724391581765607853'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2010/04/hg-walkabout.html' title='HG Walkabout'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/_ulEPJI66qaQ/S9ob-0ctZBI/AAAAAAAAC_E/DqYxf51Eodk/s72-c/snap201004290029_thumb.png?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-5741071923208192593</id><published>2010-04-23T17:45:00.001-07:00</published><updated>2010-04-23T17:51:38.023-07:00</updated><title type='text'>IIS7 CryptographicException - The system cannot find the file specified.</title><content type='html'>I found a strange error while getting my application to run on Server 2008 R2. Below is a description of a similar problem and the resolution. Its duplicated here in case the other blog disappears in the future.&lt;br /&gt;&lt;br /&gt;From blog - &lt;a href=&quot;http://maesitus-sitecore.blogspot.com/2010/01/cryptographicexception-file-not-found.html&quot;&gt;MaeSitus-Sitecore&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;CryptographicException file not found in Sitecore&lt;br /&gt;Today I came across issue with CryptographicException file not found in Sitecore. See below&lt;br /&gt;&lt;br /&gt;Server Error in &#39;/&#39; Application.&lt;br /&gt;&lt;br /&gt;THE SYSTEM CANNOT FIND THE FILE SPECIFIED.&lt;br /&gt;&lt;br /&gt;Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.&lt;br /&gt;&lt;br /&gt;Exception Details: System.Security.Cryptography.CryptographicException: The system cannot find the file specified.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Source Error:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Stack Trace:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;[CryptographicException: The system cannot find the file specified. ]    System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer) +7715070    System.Security.Cryptography.DSACryptoServiceProvider.ImportParameters(DSAParameters parameters) +258    System.Security.Cryptography.DSA.FromXmlString(String xmlString) +501    Sitecore.Nexus.Licensing.NexusLicenseApi. (String xml, Guid instance) +138    Sitecore.Nexus.Licensing.NexusLicenseApi.GetSnapShot(Guid instance) +764    Sitecore.SecurityModel.License.LicenseManager.GetSnapshotData(Guid instance) +59    Sitecore.SecurityModel.License.LicenseManager.UpdateSnapshot() +103    Sitecore.SecurityModel.License.LicenseManager.Initialize() +8    Sitecore.Nexus.Web.HttpModule.Application_Start() +76    Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +435    System.Web.HttpApplication.InitModulesCommon() +65    System.Web.HttpApplication.InitModules() +43    System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +729    System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +298    System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107    System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +289&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;After consulting with my colleague, the solution is to do with IIS settings.&lt;br /&gt;&lt;br /&gt;To resolve this,&lt;br /&gt;&lt;br /&gt;1. go to IIS Manager&lt;br /&gt;2. go to the application pool instance&lt;br /&gt;3. click advanced settings&lt;br /&gt;4. Under Process model, set Load User Profile to true</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/5741071923208192593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2010/04/iis7-cryptographicexception-system.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/5741071923208192593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/5741071923208192593'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2010/04/iis7-cryptographicexception-system.html' title='IIS7 CryptographicException - The system cannot find the file specified.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-8057727184536186196</id><published>2009-12-12T14:01:00.001-08:00</published><updated>2009-12-12T14:01:37.894-08:00</updated><title type='text'>Getting Fluent NHibernate running under Windows 7</title><content type='html'>&lt;p&gt;I just finished wiping my development box and going from Vista to Windows 7. Overall it wasn’t too bad. I did encounter two problems trying to get our unit tests (xUnit) running again.&lt;/p&gt;  &lt;p&gt;The first problem was that I had copied the Source directory from my Vista install to the Windows 7 install. Almost everything was good until I run two tests that were getting a &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.reflection.reflectiontypeloadexception.aspx&quot;&gt;ReflectionTypeLoadException&lt;/a&gt;. That exception tells you to take a look at the LoaderExceptions property. When I did that I noticed that it was complaining about the fact that some of the DLLs that were being loaded (specifically FluentNHibernate.dll) was from a different machine. To fix this, I removed the copied Libraries folder and updated again from CVS. That problem then went away.&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/8057727184536186196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2009/12/getting-fluent-nhibernate-running-under.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/8057727184536186196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/8057727184536186196'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2009/12/getting-fluent-nhibernate-running-under.html' title='Getting Fluent NHibernate running under Windows 7'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-6686091732119581664</id><published>2009-04-03T22:02:00.000-07:00</published><updated>2009-04-03T22:07:52.780-07:00</updated><title type='text'>Enabling syntax highlighting in your Blogger Blog</title><content type='html'>This is a test of the &lt;a href=&quot;http://alexgorbatchev.com/wiki/SyntaxHighlighter&quot;&gt;SyntaxHighlighter&lt;/a&gt; code snippet formatter.&lt;div&gt;&lt;pre name=&quot;code&quot; class=&quot;brush: c-sharp;&quot;&gt;&lt;br /&gt;public void Foo(string bar, int baz)&lt;br /&gt;{&lt;br /&gt;if (YouSeeThis())&lt;br /&gt;{&lt;br /&gt;  Console.WriteLine(&quot;It worked!&quot;);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;For the above to work you need to have the following code:&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;brush: js;&quot;&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shCore.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushBash.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushCpp.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushCSharp.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushCss.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushDelphi.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushDiff.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushGroovy.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushJava.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushJScript.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushPhp.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushPlain.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushPython.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushRuby.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushScala.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushSql.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushVb.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushXml.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;link href=&#39;http://[yourhostname]/styles/shCore.css&#39; rel=&#39;stylesheet&#39; type=&#39;text/css&#39;/&gt;&lt;br /&gt;&amp;lt;link href=&#39;http://[yourhostname]/styles/shThemeDefault.css&#39; rel=&#39;stylesheet&#39; type=&#39;text/css&#39;/&gt;&lt;br /&gt;&amp;lt;script class=&#39;javascript&#39;&gt;&lt;br /&gt;//&amp;lt;![CDATA[&lt;br /&gt;function FindTagsByName(container, name, Tag){&lt;br /&gt;var elements = document.getElementsByTagName(Tag);&lt;br /&gt;for (var i = 0; i &amp;lt; elements.length; i++){&lt;br /&gt;  if (elements[i].getAttribute(&quot;name&quot;) == name){&lt;br /&gt;    container.push(elements[i]);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;var elements = [];&lt;br /&gt;FindTagsByName(elements, &#39;code&#39;, &#39;pre&#39;);&lt;br /&gt;FindTagsByName(elements, &#39;code&#39;, &#39;textarea&#39;);&lt;br /&gt;&lt;br /&gt;for(var i=0; i &amp;lt; elements.length; i++) {&lt;br /&gt;if(elements[i].nodeName.toUpperCase() == &#39;TEXTAREA&#39;) {&lt;br /&gt;  var childNode = elements[i].childNodes[0];&lt;br /&gt;  var newNode = document.createTextNode(childNode.nodeValue&lt;br /&gt;    .replace(/&amp;lt;br\s*\/?&gt;/gi,&#39;\n&#39;));&lt;br /&gt;  elements[i].replaceChild(newNode, childNode);&lt;br /&gt;}&lt;br /&gt;else if(elements[i].nodeName.toUpperCase() == &#39;PRE&#39;) {&lt;br /&gt;  brs = elements[i].getElementsByTagName(&#39;br&#39;);&lt;br /&gt;  for(var j = 0, brLength = brs.length; j &amp;lt; brLength; j++) {&lt;br /&gt;    var newNode = document.createTextNode(&quot;\n&quot;);&lt;br /&gt;    elements[i].replaceChild(newNode, brs[0]);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;SyntaxHighlighter.all();&lt;br /&gt;//]]&gt;&lt;br /&gt;&amp;lt;/script&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Thanks go to the following for getting this working:&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;a href=&quot;http://alexgorbatchev.com/wiki/SyntaxHighlighter&quot;&gt;http://alexgorbatchev.com/wiki/SyntaxHighlighter&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href=&quot;http://developertips.blogspot.com/2007/08/syntaxhighlighter-on-blogger.html&quot;&gt;Tips for software engineer: Using SyntaxHighlighter on BLOGGER&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/6686091732119581664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2009/04/enabling-syntax-highlighting-in-your.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/6686091732119581664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/6686091732119581664'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2009/04/enabling-syntax-highlighting-in-your.html' title='Enabling syntax highlighting in your Blogger Blog'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-7839635812745448739</id><published>2009-04-03T21:11:00.000-07:00</published><updated>2009-04-03T21:59:33.670-07:00</updated><title type='text'>Test of SyntaxHighlighter</title><content type='html'>This is a test of the &lt;a href=&quot;http://alexgorbatchev.com/wiki/SyntaxHighlighter&quot;&gt;SyntaxHighlighter&lt;/a&gt; code snippet formatter.&lt;div&gt;&lt;pre name=&quot;code&quot; class=&quot;brush: c-sharp;&quot;&gt;&lt;br /&gt;public void Foo(string bar, int baz)&lt;br /&gt;{&lt;br /&gt; if (YouSeeThis())&lt;br /&gt; {&lt;br /&gt;   Console.WriteLine(&quot;It worked!&quot;);&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;For the above to work you need to have the following code:&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;brush: js;&quot;&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shCore.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushBash.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushCpp.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushCSharp.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushCss.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushDelphi.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushDiff.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushGroovy.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushJava.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushJScript.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushPhp.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushPlain.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushPython.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushRuby.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushScala.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushSql.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushVb.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;script src=&#39;http://[yourhostname]/scripts/shBrushXml.js&#39; type=&#39;text/javascript&#39;/&gt;&lt;br /&gt;&amp;lt;link href=&#39;http://[yourhostname]/styles/shCore.css&#39; rel=&#39;stylesheet&#39; type=&#39;text/css&#39;/&gt;&lt;br /&gt;&amp;lt;link href=&#39;http://[yourhostname]/styles/shThemeDefault.css&#39; rel=&#39;stylesheet&#39; type=&#39;text/css&#39;/&gt;&lt;br /&gt;&amp;lt;script class=&#39;javascript&#39;&gt; &lt;br /&gt;//&amp;lt;![CDATA[&lt;br /&gt;function FindTagsByName(container, name, Tag){&lt;br /&gt; var elements = document.getElementsByTagName(Tag);&lt;br /&gt; for (var i = 0; i &amp;lt; elements.length; i++){&lt;br /&gt;   if (elements[i].getAttribute(&quot;name&quot;) == name){&lt;br /&gt;     container.push(elements[i]);&lt;br /&gt;   }&lt;br /&gt; } &lt;br /&gt;} &lt;br /&gt;var elements = []; &lt;br /&gt;FindTagsByName(elements, &#39;code&#39;, &#39;pre&#39;); &lt;br /&gt;FindTagsByName(elements, &#39;code&#39;, &#39;textarea&#39;); &lt;br /&gt;&lt;br /&gt;for(var i=0; i &amp;lt; elements.length; i++) {&lt;br /&gt; if(elements[i].nodeName.toUpperCase() == &#39;TEXTAREA&#39;) {&lt;br /&gt;   var childNode = elements[i].childNodes[0]; &lt;br /&gt;   var newNode = document.createTextNode(childNode.nodeValue&lt;br /&gt;     .replace(/&amp;lt;br\s*\/?&gt;/gi,&#39;\n&#39;)); &lt;br /&gt;   elements[i].replaceChild(newNode, childNode); &lt;br /&gt; }&lt;br /&gt; else if(elements[i].nodeName.toUpperCase() == &#39;PRE&#39;) {&lt;br /&gt;   brs = elements[i].getElementsByTagName(&#39;br&#39;); &lt;br /&gt;   for(var j = 0, brLength = brs.length; j &amp;lt; brLength; j++) {&lt;br /&gt;     var newNode = document.createTextNode(&quot;\n&quot;); &lt;br /&gt;     elements[i].replaceChild(newNode, brs[0]); &lt;br /&gt;   } &lt;br /&gt; } &lt;br /&gt;}&lt;br /&gt;SyntaxHighlighter.all(); &lt;br /&gt;//]]&gt; &lt;br /&gt;&amp;lt;/script&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Thanks go to the following for getting this working:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://developertips.blogspot.com/2007/08/syntaxhighlighter-on-blogger.html&quot;&gt;http://developertips.blogspot.com/2007/08/syntaxhighlighter-on-blogger.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;http://alexgorbatchev.com/wiki/SyntaxHighlighter&quot;&gt;http://alexgorbatchev.com/wiki/SyntaxHighlighter&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/7839635812745448739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2009/04/test-of-syntaxhighlighter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/7839635812745448739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/7839635812745448739'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2009/04/test-of-syntaxhighlighter.html' title='Test of SyntaxHighlighter'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-1879528667317409334</id><published>2009-04-02T15:35:00.001-07:00</published><updated>2009-04-02T17:13:21.649-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET 3.5"/><category scheme="http://www.blogger.com/atom/ns#" term="ClickOnce"/><category scheme="http://www.blogger.com/atom/ns#" term="Installer"/><category scheme="http://www.blogger.com/atom/ns#" term="MSBuild"/><category scheme="http://www.blogger.com/atom/ns#" term="Nant"/><title type='text'>NAnt/MSBuild ClickOnce publishing ‘publish.htm’</title><content type='html'>&lt;p&gt;The secret to this is specifying in the properties passed to MSBuild either directly or via NAnt. There are two specific properties you need to get the publish.htm published:&lt;/p&gt;  &lt;table width=&quot;398&quot; border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;203&quot;&gt;CreateWebPageOnPublish&lt;/td&gt;        &lt;td valign=&quot;top&quot; width=&quot;193&quot;&gt;true&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;205&quot;&gt;WebPage&lt;/td&gt;        &lt;td valign=&quot;top&quot; width=&quot;192&quot;&gt;publish.htm&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;You can specify these as command line parameters as follows:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;/property:CreateWebPageOnPublish=true&lt;/p&gt;    &lt;p&gt;/property:WebPage=publish.htm&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Once you are passing these parameters to MSBUILD it will move your publish.htm up to your publish location. Note, that there are many more properties that you can specify in the same way. Take a look inside of your .csproj file Property/PropertyGroup for a list of the values. You can experiment with the GUI inside of Visual Studio and then see how the values change so you can tweak your MSBuild/NAnt script accordingly.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 0, 0);&quot;&gt;UPDATE&lt;/span&gt;: It turns out I&#39;m wrong on this. The above solution does not auto-generate a publish.htm. More to follow.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;  &lt;div class=&quot;wlWriterEditableSmartContent&quot; id=&quot;scid:0767317B-992E-4b12-91E0-4F059A8CECA8:9bf302c1-e4d5-4ed5-b044-ecccc44ec5ba&quot; style=&quot;margin: 0px; padding: 0px; display: inline; float: none;&quot;&gt;Technorati Tags: &lt;a href=&quot;http://technorati.com/tags/ClickOnce&quot; rel=&quot;tag&quot;&gt;ClickOnce&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/NAnt&quot; rel=&quot;tag&quot;&gt;NAnt&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/MSBuild&quot; rel=&quot;tag&quot;&gt;MSBuild&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/1879528667317409334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2009/04/nantmsbuild-clickonce-publishing.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/1879528667317409334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/1879528667317409334'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2009/04/nantmsbuild-clickonce-publishing.html' title='NAnt/MSBuild ClickOnce publishing ‘publish.htm’'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-257907558594817469</id><published>2009-04-02T15:24:00.001-07:00</published><updated>2009-04-02T15:24:44.846-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET 3.5"/><category scheme="http://www.blogger.com/atom/ns#" term="ClickOnce"/><category scheme="http://www.blogger.com/atom/ns#" term="Installer"/><title type='text'>Adding your own Pre-requisite installer to a ClickOnce app</title><content type='html'>&lt;h2&gt;STEPS&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;Download and install the &lt;a href=&quot;http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=bmg&amp;amp;ReleaseId=1567&quot; target=&quot;_blank&quot;&gt;Bootstrap Manifest Generator&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Start a New Project and choose Package Manifest&lt;/li&gt;    &lt;li&gt;Give your project a name and code (these can be the same)&lt;/li&gt;    &lt;li&gt;Click on Project/Add Install File and choose your installer&lt;/li&gt;    &lt;li&gt;Give a Display Name in the Install File settings&lt;/li&gt;    &lt;li&gt;Build your project with Project/Build&lt;/li&gt;    &lt;li&gt;On Vista this will ignore any properties about where it creates the file. Look for it in \Users\{username}\Documents\{Project Name}&lt;/li&gt;    &lt;li&gt;Copy this to your packages location. Usually here: C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;You should now be able to choose this in your Project Properties\Publish\Prerequisites list.&lt;/p&gt;  &lt;h2&gt;LINKS&lt;/h2&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href=&quot;http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=bmg&amp;amp;ReleaseId=1567&quot; target=&quot;_blank&quot;&gt;Bootstrap Manifest Generator&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href=&quot;http://webpurityltd.wordpress.com/2008/03/24/customising-your-clickonce-deployment/&quot; target=&quot;_blank&quot;&gt;Customising your ClickOnce deployment&lt;/a&gt;&lt;/p&gt;    &lt;div class=&quot;wlWriterEditableSmartContent&quot; id=&quot;scid:0767317B-992E-4b12-91E0-4F059A8CECA8:4a8ed220-cc64-4864-969d-bdd9661f2a3e&quot; style=&quot;padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px&quot;&gt;Technorati Tags: &lt;a href=&quot;http://technorati.com/tags/ClickOnce&quot; rel=&quot;tag&quot;&gt;ClickOnce&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/Installer&quot; rel=&quot;tag&quot;&gt;Installer&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/.NET+3.5&quot; rel=&quot;tag&quot;&gt;.NET 3.5&lt;/a&gt;&lt;/div&gt;&lt;/blockquote&gt;  </content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/257907558594817469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2009/04/adding-your-own-pre-requisite-installer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/257907558594817469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/257907558594817469'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2009/04/adding-your-own-pre-requisite-installer.html' title='Adding your own Pre-requisite installer to a ClickOnce app'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-3928026801764329658</id><published>2009-03-16T22:38:00.001-07:00</published><updated>2009-03-16T22:40:02.927-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Deployment"/><category scheme="http://www.blogger.com/atom/ns#" term="Nant"/><category scheme="http://www.blogger.com/atom/ns#" term="TDD"/><title type='text'>Is your application ready for deployment?</title><content type='html'>&lt;p&gt;So, you’ve coded like a banshee for 7 weeks straight, listened to your manager badger you about “sprint” this, “agile” that, “can you tell me when its really going to be ready to install at the customer’s site?&lt;/p&gt;  &lt;p&gt;Well, before you go there, you should run through a pre-deployment checklist. Here’s one that I’ve come up with after going through the motions on a number of occasions.&lt;/p&gt;  &lt;h2&gt;Build and CI&lt;/h2&gt;  &lt;p&gt;If you’re not using &lt;a href=&quot;http://en.wikipedia.org/wiki/Nant&quot; target=&quot;_blank&quot;&gt;NAnt&lt;/a&gt; or &lt;a href=&quot;http://en.wikipedia.org/wiki/Msbuild&quot; target=&quot;_blank&quot;&gt;MSBUILD&lt;/a&gt; scripts then start right now! The first thing you should do when you’re building out your new project source tree is to get it committed to your version control system and then make sure it will be built by your Continuous Integration server.&lt;/p&gt;  &lt;p&gt;By integrating constantly you’ll know when the changes you are making are going to break what someone else is working on. I hear talking about changes they’ve held on to for weeks before attempting to commit them to version control out of fear of breaking the build. Face it, the days of Big Bang check-ins and waiting for the nightly build are light years behind us now.&amp;#160; To move fast, we have to identify the risks before it hits the deadline.&lt;/p&gt;  &lt;h2&gt;DO YOU KNOW YOUR INSTALLER?&lt;/h2&gt;  &lt;p&gt;How many times have you been burned by this: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Larry - You know, file fizzbin.dll is missing from the build.&lt;/p&gt;    &lt;p&gt;Joe – Did you add it to the installer?&lt;/p&gt;    &lt;p&gt;Larry – We have an installer?&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Alright, I played that up a bit, but you catch my drift. Installers can be quite complicated beasties. In my team, I adopted a stripped down open source installer (Inno Setup). Sure, it doesn’t have all of the bells and whistles of some of the big name installers, but its damn simple. I combined that with something that we use every day (NAnt) and now we’ve got a half-way decent installer pattern.&lt;/p&gt;  &lt;p&gt;If you write code, you should understand how your bits (DLLs, XML files, web files) get to where they need to go. Here are some things you should ask yourself about any file that needs to go into the installer:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Is this a DLL? Is it already part of one of the projects whose output will be installed to the ‘bin’ directory, or is this something new?&lt;/li&gt;    &lt;li&gt;Is this a Configuration File? Should the values be preserved between installations/upgrades? How should I take care of values that are Added/Removed/Updated? Which services will access this file? Will the correct permissions be assigned to the file/directory? Does this file need to survive an uninstall?&lt;/li&gt;    &lt;li&gt;Is this a web virtual? Is there anything special that needs to be done to the virtual in the IIS Configuration? Does it need to be locked down?&lt;/li&gt;    &lt;li&gt;Is this a Windows Service? Have you followed the same naming conventions for the name, the .exe, the log file? The three of these should be similar in name so its easier for support to identify which service is associated with which executable and log file.&lt;/li&gt;    &lt;li&gt;Logging? Did you make sure that you are logging to the Log directory?&lt;/li&gt;    &lt;li&gt;Are there files that you no longer want to be included?&lt;/li&gt; &lt;/ol&gt;  &lt;h2&gt;HARD CODED VALUES&lt;/h2&gt;  &lt;p&gt;OK, nobody does this anymore. We all have all the time we need to isolate the hard coded strings and have already moved them to configuration files or they reside inside of a resource file.&lt;/p&gt;  &lt;p&gt;Now really, we all do this in our rush to quickly prototype the code we’ve got to get finished for the upcoming trade show or GA release of version 5.8. But really, you need to identify and move these values first to say a common access class and from there to a configuration file. &lt;/p&gt;  &lt;h2&gt;Check your configuration files&lt;/h2&gt;  &lt;p&gt;So all the code is done, you’ve made it through your xUnit tests and QA is saying that the risks are acceptable to deploy this app. And yet the application most likely has never been deployed to an environment similar to your (or your customer’s) production environment. So, now comes the hard part, we have to adjust all those configuration settings (URLs, passwords, connection strings, file paths, frequency values, etc). Sure that’s great. I know where all of those are. OK, but how many of those values are REPEATED in your configuration files? You know like, IP addresses to servers, account names, etc.&lt;/p&gt;  &lt;p&gt;For those of us that enjoy using &lt;a title=&quot;Resharper&quot; href=&quot;http://www.jetbrains.com/resharper&quot; target=&quot;_blank&quot;&gt;Resharper&lt;/a&gt; you become smoking ninja’s with your ability to keep your code &lt;a title=&quot;Don&amp;#39;t Repeat Yourself&quot; href=&quot;http://en.wikipedia.org/wiki/Don&#39;t_repeat_yourself&quot; target=&quot;_blank&quot;&gt;DRY&lt;/a&gt;. But what about the ‘data’ in your configurations? How many connection strings do you reference? Do you have URL’s for &lt;a title=&quot;Windows Communication Foundation&quot; href=&quot;http://en.wikipedia.org/wiki/Windows_Communication_Foundation&quot; target=&quot;_blank&quot; rel=&quot;tag&quot;&gt;WCF&lt;/a&gt; services that contain the same server name over and over again?&lt;/p&gt;  &lt;p&gt;If we apply the DRY principle to our configuration files as well as our code, then its far easier to create instructions on which values to change for production deployment, or better yet to automate or provide tools to safely adjust these values (and even better yet, make sure that the values that are in the configuration files will work when the service/application is running!)&lt;/p&gt;  &lt;h2&gt;Database connection string&lt;/h2&gt;  &lt;p&gt;Hey, you’ve tested this, you know it works. Works for me! Every time. Recently we had a “head scratching” moment with our newly arrived QA engineer. She’d built out a VM and installed our software on it to discover that one of our applications didn’t run at all after installation. My team looked at it and said, “Hmmm… that can’t be happening. It works everywhere else. Let’s rebuild your server and install again.” So, after rebuilding the server it worked fine and dandy.&lt;/p&gt;  &lt;p&gt;Some weeks later, I stumbled upon a hard coded connection string in the previously mentioned application and had my “AH-HA” moment, “So this is why it failed!”. If you’ve been reading above then we should have reviewed this and identified that first, there was a hard coded string containing a connection string and second it was duplicated.&lt;/p&gt;  &lt;p&gt;So, what’s the lesson here? Well, the deployment environment should be taken into account even when a developer is writing and testing his/her own code. In this particular case, we would have recognized that the connection string was pointed to localhost\sqlexpress and it needed to honor what has in our connections.config file.&lt;/p&gt;  &lt;h2&gt;mock me? NO MOCK YOU!&lt;/h2&gt;  &lt;p&gt;OK, funny! In today’s world we need to be able to provide “fake” interfaces or simulate external services. The only way to make sure that you’re really ready for the vagaries of what you’ll find out in the production wilderness is to mock the different services that you connect to. The benefits will allow you to have confidence that the application you’ve written will stand up when it encounters unexpected results. &lt;/p&gt;  &lt;p&gt;This is really a follow on to TDD. Test driven development actually leads to building out mocked interfaces.&lt;/p&gt;  &lt;h2&gt;Naming Conventions&lt;/h2&gt;  &lt;p&gt;If you are writing an application for a company and there is more than one application you’ll want to follow similar patterns when naming and identifying your application. Things to keep in mind:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Keep track of the ports that you use if you use WCF services, proprietary listeners, etc. Support and the customer will want to know if your application needs to have inbound or outbound access on specific ports. Also, when it comes to TCP/IP ports, you really should check for a port range that is not used by other applications. Anymore, that is up in the 38,000+ range and anything below 10,000 should be reviewed carefully.&lt;/li&gt;    &lt;li&gt;Name your virtuals so they are consistent, easy to type and make sense for their intended purpose.&amp;#160; Again you might have a common prefix for your application suite, or common suffixes for types of applications.&lt;/li&gt;    &lt;li&gt;Windows services are a big pet peeve of mine. Make sure you’ve made sure that you have a consistent Service Name, Display Name and you’ve taken some time to write a decent 10-20 word description of what the service is.&lt;/li&gt;    &lt;li&gt;Finally, make sure that your DLLs have the appropriate information in the ApplicationInfo files. The Company Name, Copyright, Product Name and version should all be there and be current. You can accomplish this by hand or by incorporating some steps into your build file.&lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;Last Thoughts&lt;/h2&gt;  &lt;p&gt;This is entirely too long and I’ve most likely lost a lot of people by now. But the last step you should think through is about what you’ve done to your application during your own testing. Do you normally change values in the configuration files to debug settings? Have you deployed with the Log Level set to Debug? Have left the web.config with the debug turned on? Are you including your symbol files?&lt;/p&gt;  &lt;p&gt;There’s a lot more of these types of questions that you should think about when you release your application into the wild. Some of this is about your ability to control your ADD (attention deficit disorder or bright shiny object chasing) and concentrate for an hour or two on the questions and topics I’ve brought up here. &lt;/p&gt;  &lt;p&gt;&lt;span style=&quot;font-weight: bold&quot;&gt;Now Playing&lt;/span&gt; - Tom Scott - Reed My Lips - Saxappella&lt;/p&gt;  &lt;p&gt;   &lt;div class=&quot;wlWriterEditableSmartContent&quot; id=&quot;scid:0767317B-992E-4b12-91E0-4F059A8CECA8:ce6e5b67-e9a4-4894-afc8-e1d10816d9ff&quot; style=&quot;padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px&quot;&gt;Technorati Tags: &lt;a href=&quot;http://technorati.com/tags/nant&quot; rel=&quot;tag&quot;&gt;nant&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/msbuild&quot; rel=&quot;tag&quot;&gt;msbuild&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/deployment&quot; rel=&quot;tag&quot;&gt;deployment&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/tdd&quot; rel=&quot;tag&quot;&gt;tdd&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/conifguration&quot; rel=&quot;tag&quot;&gt;conifguration&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/3928026801764329658/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2009/03/is-your-application-ready-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/3928026801764329658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/3928026801764329658'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2009/03/is-your-application-ready-for.html' title='Is your application ready for deployment?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-1101832966862797845</id><published>2009-03-12T23:38:00.001-07:00</published><updated>2009-03-12T23:41:51.514-07:00</updated><title type='text'>xUnit tests and threads</title><content type='html'>&lt;p&gt;OK, it goes against the idea of unit testing a little bit, but sometimes you can only get some code to fail by having another thread attempt to change a shared value. In my case, I hade a piece of code like this:&lt;/p&gt;  &lt;div style=&quot;border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4&quot;&gt;   &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none&quot;&gt;var thread = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; Thread(() =&amp;gt; Assert.NotNull(&lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;));&lt;br /&gt;thread.Start();&lt;br /&gt;thread.Join();&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This block of code starts a thread and checks that the value, null, is not null. The xUnit Assert will throw an exception once the thread is running. What happens to uncaught exceptions in threads? In the old 1.0 and 1.1 days the thread would terminate silently. It turns out that this is what this code will do if you attempt to run it in TestDriven.Net. In other words, the test will not fail!&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;To get this to work the Assert needs to be surrounded by a try/catch block.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4&quot;&gt;&lt;br /&gt;  &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none&quot;&gt;var thread = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; Thread(SafeAssertBlock);&lt;br /&gt;thread.Start();&lt;br /&gt;thread.Join();&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; SafeAssertBlock() {&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;try&lt;/span&gt; {&lt;br /&gt;        Assert.NotNull(&lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;);&lt;br /&gt;    }&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;catch&lt;/span&gt; (Exception ex) {&lt;br /&gt;        &lt;span style=&quot;color: #008000&quot;&gt;// log the exception or pass it back to the owning thread...&lt;/span&gt;&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;What I eventually settled on was a form like this.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4&quot;&gt;&lt;br /&gt;  &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; Exception ThreadsException { get; set; }&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;  ExceptionCatcher(() =&amp;gt; Assert.Null(ContextScope&amp;lt;&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;&amp;gt;.GetInstance(ScopeKey)));&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; ExceptionCatcher(Action action)&lt;br /&gt;{&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;try&lt;/span&gt;&lt;br /&gt;    {&lt;br /&gt;        ThreadsException = &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;        action();&lt;br /&gt;    }&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;catch&lt;/span&gt; (Exception ex)&lt;br /&gt;    {&lt;br /&gt;        Logger.Error(ex.GetBaseException().Message);&lt;br /&gt;        ThreadsException = ex;&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This passes the Assertion block into the ExceptionCatcher, which in turn sets a variable named ThreadsException back in the main thread. If ThreadsException is not null after we make the call then we can log that exception or re-throw it.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;So, what happens to xUnit if you attempt to test code that throws an exception in a thread? It turns out that each test is run in its own AppDomain and when the exception is thrown there is an attempt to Serialize the exception. I&#39;m not totally sure, but I believe that communication between AppDomains uses .NET Remoting. In any case, you get an ugly Marshalling exception down in the guts. This may have been helped if the xUnit guys had decided to have their Exception types be Serializable and have the appropriate serialization constructors. Perhaps in a later release?&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/1101832966862797845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2009/03/xunit-tests-and-threads.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/1101832966862797845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/1101832966862797845'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2009/03/xunit-tests-and-threads.html' title='xUnit tests and threads'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-4691893725693560178</id><published>2009-03-12T19:15:00.001-07:00</published><updated>2009-03-12T19:15:21.498-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Threading"/><title type='text'>Thread-specific data and the FreeNamedDataSlot function</title><content type='html'>&lt;p&gt;First a bit of “context” setting before we proceed. If you’ve ever wanted to store data that is local to a single thread, you have three alternatives depending on your environment. If you’re only inside of a HTTP Web Request, you are in luck as you can set data into the HttpContext.Current.Items and its good for the duration of that web request.&lt;/p&gt;  &lt;p&gt;If you happen to be writing any other type of application (Console, Windows Forms, Windows Service, etc…) then you have two alternatives. The easiest is to make a field with the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.threadstaticattribute.aspx#&quot; target=&quot;_blank&quot;&gt;ThreadStaticAttribute&lt;/a&gt;. You use this on a static field. With this attribute each thread has its own version of the field. That’s pretty easy!&lt;/p&gt;  &lt;p&gt;If you want a little more control (or headaches) then you can use the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.threading.thread.getnameddataslot(VS.85).aspx#&quot; target=&quot;_blank&quot;&gt;Thread.GetNamedDataSlot&lt;/a&gt; and the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.threading.thread.getdata.aspx&quot; target=&quot;_blank&quot;&gt;Thread.GetData&lt;/a&gt;/&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.threading.thread.setdata.aspx&quot; target=&quot;_blank&quot;&gt;Thread.SetData&lt;/a&gt; methods. What do all these do? Well, GetNamedDataSlot looks for a data slot on the current thread with the name that you pass to the method. If no slot is found it lazily instantiates one for you. The value returned is used as an argument to the GetData and the SetData methods, in other words your getter and setter for accessing thread local data.&lt;/p&gt;  &lt;p&gt;BEWARE: There is another static method named &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.threading.thread.freenameddataslot.aspx&quot; target=&quot;_blank&quot;&gt;FreeNamedDataSlot&lt;/a&gt; which you should use with extreme caution or not at all. This will free all of the data slots from &lt;strong&gt;&lt;em&gt;each and every&lt;/em&gt;&lt;/strong&gt; thread! The only time this makes sense to use is when you are absolutely sure that there are no threads running that are making use of the named slot you are about to free.&lt;/p&gt;  &lt;div class=&quot;wlWriterEditableSmartContent&quot; id=&quot;scid:0767317B-992E-4b12-91E0-4F059A8CECA8:1421dd7b-58bc-427c-8ba7-b31b278b39bb&quot; style=&quot;padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px&quot;&gt;Technorati Tags: &lt;a href=&quot;http://technorati.com/tags/.NET&quot; rel=&quot;tag&quot;&gt;.NET&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/Threading&quot; rel=&quot;tag&quot;&gt;Threading&lt;/a&gt;&lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/4691893725693560178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2009/03/thread-specific-data-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/4691893725693560178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/4691893725693560178'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2009/03/thread-specific-data-and.html' title='Thread-specific data and the FreeNamedDataSlot function'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-4287600978822785933</id><published>2009-03-06T19:40:00.001-08:00</published><updated>2009-03-08T14:21:40.419-07:00</updated><title type='text'>Preview of Pioneer Connectivity Framework</title><content type='html'>&lt;p&gt;&lt;a href=&quot;http://jtheisen-desk2.kryptiq.com/blog/images/localhost/blog/WindowsLiveWriter/PreviewofPioneerAgentFramework_13A0A/pioneer-preview1_2.png&quot; rel=&quot;lightbox&quot;&gt;&lt;img title=&quot;Pioneer Debugger&quot; style=&quot;border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin-left: 0px; margin-right: 0px; border-right-width: 0px&quot; height=&quot;270&quot; alt=&quot;Pioneer Debugger&quot; src=&quot;http://jtheisen-desk2.kryptiq.com/blog/images/localhost/blog/WindowsLiveWriter/PreviewofPioneerAgentFramework_13A0A/pioneer-preview1_thumb.png&quot; width=&quot;283&quot; align=&quot;right&quot; border=&quot;0&quot;&gt;&lt;/a&gt;There have been rumors of what I was working on while in China. Since the first days of the Network I’ve imagined that we would have an agent that could be deployed to environments and be able to perform relatively simply operations.&lt;/p&gt; &lt;p&gt;The Pioneer &lt;strike&gt;Agent&lt;/strike&gt; Connectivity Framework is the realization of this. To the right you see an example of the debugger running a script.&lt;/p&gt; &lt;p&gt;OK, but what is the Pioneer Connectivity Framework and what can we do with it? The Framework consists of the following components: a runtime with its own DSL (tokenizer, parser and interpreter that runs inside of the .NET 3.5), a Windows Service with installer to allow the runtime to be deployed on other computers, an interactive debugger to enable development, testing and diagnosing issues with the framework, connectivity to the CIQ Network, connectivity to any ADO.NET based database, a timer subsystem to allow for timed operations, and finally a file watching subsystem to watch folders for changed files. Phew! That was a mouthful.&lt;/p&gt; &lt;p&gt;OK, but why a new language on top of all the rest of this? Well, I’ve seen so many instances where we’ve deployed applications only to have to quickly act on an escalation to solve problems at customer sites. We’ve worked around a lot of deployment issues by isolating query files, but we’ve not extended this to the other aspects of our programming. With a small, light-weight language --&amp;nbsp; a domain specific language --&amp;nbsp; it will be possible to stitch together applications using a minimal amount of code.&lt;/p&gt; &lt;p&gt;Another possibility will be to deploy the agent without any of its application specific knowledge, this can be downloaded later by sending an event via the Network to obtain the latest code based on the environment and appropriate version.&lt;/p&gt; &lt;h3&gt;Keywords&lt;/h3&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;if, then, else&lt;/strong&gt; – conditional statement  &lt;li&gt;&lt;strong&gt;event&lt;/strong&gt; – a way to access the event properties inside of a subscribe, timer and watch event definition. An example of this is event(‘FullPath’) in a watch definition will return the path to the file that was changed/deleted/created.  &lt;li&gt;&lt;strong&gt;true/false&lt;/strong&gt; – boolean constants  &lt;li&gt;&lt;strong&gt;func&lt;/strong&gt; – a function definition. There are no signatures to the functions similar to JavaScript. A function and a procedure are defined by whether they return a value.  &lt;li&gt;&lt;strong&gt;include&lt;/strong&gt; – inclusion of other pioneer script files  &lt;li&gt;&lt;strong&gt;invoke&lt;/strong&gt; – a way to call into the .NET BCL  &lt;li&gt;&lt;strong&gt;namespace&lt;/strong&gt; – able to mark function and variable definitions in different namespaces  &lt;li&gt;&lt;strong&gt;null&lt;/strong&gt; – the null constant  &lt;li&gt;&lt;strong&gt;return&lt;/strong&gt; – the ability to return from a function and/or return a value from a function.  &lt;li&gt;&lt;strong&gt;start/stop&lt;/strong&gt; – mechanism to start and stop previously defined timers  &lt;li&gt;&lt;strong&gt;subscribe&lt;/strong&gt; – define a subscription to a received network event/network document  &lt;li&gt;&lt;strong&gt;timer&lt;/strong&gt; – define a new timer that expires at a definite time, a relative time or is recurring  &lt;li&gt;&lt;strong&gt;using&lt;/strong&gt; – a way to define a namespace that should be searched when calling functions or referencing variables  &lt;li&gt;&lt;strong&gt;watch&lt;/strong&gt; – define a folder watcher  &lt;li&gt;&lt;strong&gt;while, do, break&lt;/strong&gt; – a looping statement  &lt;li&gt;&lt;strong&gt;end&lt;/strong&gt; – the end of a block (if, while, func and namespace)  &lt;li&gt;&lt;strong&gt;var&lt;/strong&gt; – the definition of a variable &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;The language is loosely typed similar to JavaScript. It is not an object language so it is not possible to create new types, however, it is possible to obtain references to .NET types and pass those to invoke() calls.&lt;/p&gt; &lt;p&gt;The implicit types are integers,&amp;nbsp; strings and lists.&lt;/p&gt; &lt;h3&gt;Extensibility&lt;/h3&gt; &lt;p&gt;Currently there are several ‘libraries’ that can be included. By creating an include file containing one or more invoke() statements and dropping a DLL into the Library folder, brand new functionality can be added without having to recompile and redistribute the framework.&lt;/p&gt; &lt;h3&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Pioneer_10&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 0px 20px; border-right-width: 0px&quot; height=&quot;240&quot; src=&quot;http://upload.wikimedia.org/wikipedia/commons/4/46/Pioneer10-11.jpg&quot; width=&quot;186&quot; align=&quot;right&quot; border=&quot;0&quot;&gt;&lt;/a&gt;What’s with the name?&lt;/h3&gt; &lt;p&gt;I choose the name pioneer after the &lt;a href=&quot;http://en.wikipedia.org/wiki/Pioneer_program&quot; target=&quot;_blank&quot;&gt;NASA Pioneer Program&lt;/a&gt;. The most famous of the spacecraft launched with this name were the Outer Solar System Missions, Pioneer 10 and 11, launched in March ‘72 and April ‘73 respectively. Pioneer 10 was the first probe to transit to Jupiter and its sister craft visited Jupiter and Saturn.&lt;/p&gt; &lt;p&gt;That’s great! But what does this name have to do with our work? The intent of the Connectivity Framework is to work out in “remote” regions away from the home planet and return data back to other services. The Pioneer program had launches that spanned over 20 years and the last successful telemetry with Pioneer 10 was April 2002, or 30 years after it was launched!&lt;/p&gt; &lt;p&gt;My hopes are that we’ll be able to apply the Pioneer Agent Framework to many of the fast moving connectivity projects that are the “bread and butter” of what we do here.&lt;/p&gt; &lt;h3&gt;Last Words&lt;/h3&gt; &lt;p&gt;All of this rides on top of the CIQ Network Foundation Libraries that provide ease of access to the Connect IQ Network as well as provide a stable platform for hosting Windows Services. &lt;/p&gt; &lt;p&gt;As more or less of a bonus, the editor/debugger recognizes the syntax and provides coloring.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;div class=&quot;wlWriterEditableSmartContent&quot; id=&quot;scid:0767317B-992E-4b12-91E0-4F059A8CECA8:0b12d599-ef83-4f25-8a78-551b0695698a&quot; style=&quot;padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px&quot;&gt;Technorati Tags: &lt;a href=&quot;http://technorati.com/tags/DSL&quot; rel=&quot;tag&quot;&gt;DSL&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/Unity+Framework&quot; rel=&quot;tag&quot;&gt;Unity Framework&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/Fireball+Code+Editor&quot; rel=&quot;tag&quot;&gt;Fireball Code Editor&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/C%23&quot; rel=&quot;tag&quot;&gt;C#&lt;/a&gt;&lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/4287600978822785933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2009/03/preview-of-pioneer-connectivity.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/4287600978822785933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/4287600978822785933'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2009/03/preview-of-pioneer-connectivity.html' title='Preview of Pioneer Connectivity Framework'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-2781260068084206203</id><published>2009-02-25T07:26:00.000-08:00</published><updated>2009-03-12T14:34:50.692-07:00</updated><title type='text'>IIS 7.0 and IHttpModules</title><content type='html'>When using IIS 7.0 an HttpModule needs to be configured in the&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;system.webserver&amp;gt;&lt;br /&gt;  &amp;lt;modules&amp;gt;&lt;br /&gt;    &amp;lt;add type=&quot;HelloWorldModule&quot; name=&quot;HelloWorldModule&quot; /&amp;gt;&lt;br /&gt;  &amp;lt;/modules&amp;gt;&lt;br /&gt;&amp;lt;/system.webserver&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In addition to the &lt;httpmodules&gt;section for IIS 6.0. This was troubling me for several days in China using Windows Vista until I checked the help file on IHttpModules!</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/2781260068084206203/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2009/02/iis-70-and-ihttpmodules.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/2781260068084206203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/2781260068084206203'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2009/02/iis-70-and-ihttpmodules.html' title='IIS 7.0 and IHttpModules'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-3410068586231015669</id><published>2008-09-08T21:15:00.000-07:00</published><updated>2009-03-12T14:34:50.703-07:00</updated><title type='text'>ServiceController class, LINQ and Extension Methods</title><content type='html'>&lt;p&gt;I ran across a nice article &lt;a href=&quot;http://www.tryexcept.com/articles/2008/07/27/check-if-a-service-is-installed-with-servicecontroller-using-linq.html&quot;&gt;here&lt;/a&gt; on how to determine if a Windows Service is installed. I thought this would be better as an extension method. Previously, you would need to catch the InvalidOperationException and ignore it if you tried to use the ServiceController class to get information on a service that is not installed.&lt;/p&gt;  &lt;div style=&quot;border-right: #a52a2a 1px solid; padding-right: 5px; border-top: #a52a2a 1px solid; padding-left: 5px; font-size: 10pt; background: #f5f5dc; padding-bottom: 5px; border-left: #a52a2a 1px solid; color: black; padding-top: 5px; border-bottom: #a52a2a 1px solid; font-family: courier new&quot;&gt;   &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: blue&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #2b91af&quot;&gt;ServiceControllerExtensions&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;{&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;bool&lt;/span&gt; IsInstalled(&lt;span style=&quot;color: blue&quot;&gt;this&lt;/span&gt; &lt;span style=&quot;color: #2b91af&quot;&gt;ServiceController&lt;/span&gt; controller, &lt;span style=&quot;color: blue&quot;&gt;string&lt;/span&gt; serviceName)&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;return&lt;/span&gt; (&lt;span style=&quot;color: blue&quot;&gt;from&lt;/span&gt; sc &lt;span style=&quot;color: blue&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: #2b91af&quot;&gt;ServiceController&lt;/span&gt;.GetServices()&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;where&lt;/span&gt; sc.ServiceName.EqualsIgnoreCase(serviceName)&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;select&lt;/span&gt; sc).Count() &amp;gt; 0;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;}&lt;/p&gt; &lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/3410068586231015669/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2008/09/servicecontroller-class-linq-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/3410068586231015669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/3410068586231015669'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2008/09/servicecontroller-class-linq-and.html' title='ServiceController class, LINQ and Extension Methods'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-367816778564563701</id><published>2008-09-07T20:02:00.000-07:00</published><updated>2009-03-12T14:34:50.711-07:00</updated><title type='text'>Two birds with one stone (0xC0000005 failure for Google Chrome and SQLProfiler 2008)</title><content type='html'>&lt;p&gt;In my previous blog entry on &lt;a href=&quot;http://dotnetbkm.blogspot.com/2008/09/google-chrome-and-symantec-endpoint.html&quot; target=&quot;_blank&quot;&gt;Google’s Chrome and Symantec’s EndPoint&lt;/a&gt; and provided a solution, which was to disable Chrome’s sandboxing. That’s really not a good idea. I noticed last week after installing SQL Server 2008 that it also was giving the same failure.&lt;/p&gt;&lt;p&gt;I went and re-googled for a solution and found a little further down in the article about using the —no-sandbox a link to Symantec’s site. You need to tweak a value in your Registry, reboot, and then both applications can run!&lt;/p&gt;&lt;p&gt;Here’s the &lt;a href=&quot;https://forums.symantec.com/syment/board/message?board.id=endpoint_protection11&amp;amp;thread.id=15816&quot; target=&quot;_blank&quot;&gt;link&lt;/a&gt;.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/367816778564563701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2008/09/two-birds-with-one-stone-0xc0000005.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/367816778564563701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/367816778564563701'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2008/09/two-birds-with-one-stone-0xc0000005.html' title='Two birds with one stone (0xC0000005 failure for Google Chrome and SQLProfiler 2008)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-1479414644965223416</id><published>2008-09-04T10:17:00.000-07:00</published><updated>2009-03-12T14:34:50.719-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Chrome"/><title type='text'>Google&amp;#39;s Chrome and Symantec&amp;#39;s Endpoint Protection</title><content type='html'>&lt;p&gt;I installed &lt;a href=&quot;http://www.google.com/chrome&quot; target=&quot;_blank&quot;&gt;Google’s Chrome&lt;/a&gt; only to discover that our corporate anti-virus program was preventing its execution:&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/8061254@N07/2827664721/&quot;&gt;&lt;img alt=&quot;chrome-fail-a&quot; hspace=&quot;5&quot; src=&quot;http://static.flickr.com/3059/2827664721_591a33842a.jpg&quot; vspace=&quot;5&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;And then you get the nice:&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/8061254@N07/2828501708/&quot;&gt;&lt;img alt=&quot;chrome-fail-b&quot; hspace=&quot;5&quot; src=&quot;http://static.flickr.com/2147/2828501708_9a793b38d2.jpg&quot; vspace=&quot;5&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Awww… reminds me of the old &lt;a href=&quot;http://en.wikipedia.org/wiki/Sad_Mac#Sad_Mac&quot; target=&quot;_blank&quot;&gt;Sad Mac&lt;/a&gt;. I wonder if it plays the tones? Here’s a link to a temporary solution &lt;a href=&quot;http://code.google.com/p/chromium/issues/detail?id=38&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/8061254@N07/2827664745/&quot;&gt;&lt;img alt=&quot;chrome-fail-c&quot; hspace=&quot;5&quot; src=&quot;http://static.flickr.com/3191/2827664745_c54e736726.jpg&quot; vspace=&quot;5&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;And now the love…&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/8061254@N07/2828501736/&quot;&gt;&lt;img alt=&quot;chrome-fail-d&quot; hspace=&quot;5&quot; src=&quot;http://static.flickr.com/3051/2828501736_9d08cb9c1b.jpg&quot; vspace=&quot;5&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/1479414644965223416/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2008/09/google-chrome-and-symantec-endpoint.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/1479414644965223416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/1479414644965223416'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2008/09/google-chrome-and-symantec-endpoint.html' title='Google&amp;#39;s Chrome and Symantec&amp;#39;s Endpoint Protection'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-5675713672473009008</id><published>2008-09-03T10:41:00.000-07:00</published><updated>2009-03-12T14:34:50.729-07:00</updated><title type='text'>Checking/Asserting for not null with a Generic Method</title><content type='html'>&lt;p&gt;In my code I like to check parameters for&amp;nbsp;entry conditions&amp;nbsp;and assert where the parameters do not match with the contract for the method. I prefer to have a quick to type and one-line method to do so. My initial code to do this looked like the following: &lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #a52a2a 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #a52a2a 1px solid; PADDING-LEFT: 5px; FONT-SIZE: 10pt; BACKGROUND: #f5f5dc; PADDING-BOTTOM: 5px; BORDER-LEFT: #a52a2a 1px solid; COLOR: black; PADDING-TOP: 5px; BORDER-BOTTOM: #a52a2a 1px solid; FONT-FAMILY: Courier New&quot;&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&lt;span style=&quot;COLOR: blue&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;COLOR: blue&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;COLOR: blue&quot;&gt;void&lt;/span&gt; IsNotNull(&lt;span style=&quot;COLOR: blue&quot;&gt;object&lt;/span&gt; obj, &lt;span style=&quot;COLOR: blue&quot;&gt;string&lt;/span&gt; message)&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;{&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;COLOR: blue&quot;&gt;if&lt;/span&gt; (obj == &lt;span style=&quot;COLOR: blue&quot;&gt;null&lt;/span&gt;) &lt;span style=&quot;COLOR: blue&quot;&gt;throw&lt;/span&gt; &lt;span style=&quot;COLOR: blue&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;COLOR: #2b91af&quot;&gt;NullReferenceException&lt;/span&gt;(message);&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;}&lt;/p&gt;&lt;/div&gt;&lt;!--EndFragment--&gt;&lt;br /&gt;&lt;p&gt;That was great and it allowed me to check for null parameters inside of a method easily with some code that looks like this:&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #a52a2a 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #a52a2a 1px solid; PADDING-LEFT: 5px; FONT-SIZE: 10pt; BACKGROUND: #f5f5dc; PADDING-BOTTOM: 5px; BORDER-LEFT: #a52a2a 1px solid; COLOR: black; PADDING-TOP: 5px; BORDER-BOTTOM: #a52a2a 1px solid; FONT-FAMILY: Courier New&quot;&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&lt;span style=&quot;COLOR: #2b91af&quot;&gt;Assert&lt;/span&gt;.IsNotNull(account, &lt;span style=&quot;COLOR: #a31515&quot;&gt;&quot;account was null&quot;&lt;/span&gt;);&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&lt;span style=&quot;COLOR: #2b91af&quot;&gt;Assert&lt;/span&gt;.IsNotNull(account != &lt;span style=&quot;COLOR: blue&quot;&gt;null&lt;/span&gt;, &lt;span style=&quot;COLOR: #a31515&quot;&gt;&quot;account was null&quot;&lt;/span&gt;);&lt;/p&gt;&lt;/div&gt;&lt;!--EndFragment--&gt;&lt;br /&gt;&lt;p&gt;But notice that the signature of the method allows for the erroneous&amp;nbsp;account != &lt;span style=&quot;COLOR: blue&quot;&gt;null&lt;/span&gt; to be used. To prevent this I changed the signature of method to:&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #a52a2a 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #a52a2a 1px solid; PADDING-LEFT: 5px; FONT-SIZE: 10pt; BACKGROUND: #f5f5dc; PADDING-BOTTOM: 5px; BORDER-LEFT: #a52a2a 1px solid; COLOR: black; PADDING-TOP: 5px; BORDER-BOTTOM: #a52a2a 1px solid; FONT-FAMILY: Courier New&quot;&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&lt;span style=&quot;COLOR: blue&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;COLOR: blue&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;COLOR: blue&quot;&gt;void&lt;/span&gt; IsNotNull&amp;lt;T&amp;gt;(T obj, &lt;span style=&quot;COLOR: blue&quot;&gt;string&lt;/span&gt; message)&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;COLOR: blue&quot;&gt;where&lt;/span&gt; T : &lt;span style=&quot;COLOR: blue&quot;&gt;class&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;{&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;COLOR: blue&quot;&gt;if&lt;/span&gt; (obj == &lt;span style=&quot;COLOR: blue&quot;&gt;null&lt;/span&gt;) &lt;span style=&quot;COLOR: blue&quot;&gt;throw&lt;/span&gt; &lt;span style=&quot;COLOR: blue&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;COLOR: #2b91af&quot;&gt;NullReferenceException&lt;/span&gt;(message);&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;}&lt;/p&gt;&lt;/div&gt;&lt;!--EndFragment--&gt;&lt;br /&gt;&lt;p&gt;Now when you inadvertently put in a value type, it will correctly report this as an error. If you are new to&amp;nbsp;Generics, then you might assume that you must identify the type. Either of the two usages below are equivalent thanks to the compiler inferring the type of the template &amp;lsquo;T&amp;rsquo;.&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #a52a2a 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #a52a2a 1px solid; PADDING-LEFT: 5px; FONT-SIZE: 10pt; BACKGROUND: #f5f5dc; PADDING-BOTTOM: 5px; BORDER-LEFT: #a52a2a 1px solid; COLOR: black; PADDING-TOP: 5px; BORDER-BOTTOM: #a52a2a 1px solid; FONT-FAMILY: Courier New&quot;&gt;&lt;span style=&quot;COLOR: #2b91af&quot;&gt;Assert&lt;/span&gt;.IsNotNull(account, &lt;span style=&quot;COLOR: #a31515&quot;&gt;&quot;account was null&quot;&lt;/span&gt;); &lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&lt;span style=&quot;COLOR: #2b91af&quot;&gt;Assert&lt;/span&gt;.IsNotNull&amp;lt;&lt;span style=&quot;COLOR: #2b91af&quot;&gt;Account&lt;/span&gt;&amp;gt;(account, &lt;span style=&quot;COLOR: #a31515&quot;&gt;&quot;account was null&quot;&lt;/span&gt;);&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;If you use &lt;a href=&quot;http://www.jetbrains.com/resharper/&quot; target=&quot;_blank&quot;&gt;Resharper&lt;/a&gt;, it will show you that you can safely remove the &amp;lt;Account&amp;gt; from the method call reporting that &amp;lsquo;Type argument specification is redundant.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/5675713672473009008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2008/09/checkingasserting-for-not-null-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/5675713672473009008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/5675713672473009008'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2008/09/checkingasserting-for-not-null-with.html' title='Checking/Asserting for not null with a Generic Method'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-9068304190217238327</id><published>2008-08-28T12:08:00.000-07:00</published><updated>2009-03-12T14:34:50.737-07:00</updated><title type='text'>Generating artificial phone numbers</title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Having worked for a company that developed phone fraud detection software in a previous life, I was familiar with the North American Numbering Plan described in &lt;a href=&quot;http://en.wikipedia.org/wiki/North_American_Numbering_Plan&quot; target=&quot;_blank&quot;&gt;Wikipedia&lt;/a&gt;. Several times I&amp;rsquo;ve had a need to create artificial phone numbers.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Below is an algorithm that will handle most if not all of these numbers.&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #a52a2a 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #a52a2a 1px solid; PADDING-LEFT: 5px; FONT-SIZE: 10pt; BACKGROUND: #f5f5dc; PADDING-BOTTOM: 5px; BORDER-LEFT: #a52a2a 1px solid; COLOR: black; PADDING-TOP: 5px; BORDER-BOTTOM: #a52a2a 1px solid; FONT-FAMILY: Courier New&quot;&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&lt;span style=&quot;COLOR: blue&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;COLOR: blue&quot;&gt;string&lt;/span&gt; GetRandomPhone()&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;{&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;COLOR: green&quot;&gt;// Generate a NANP compliant phone number (look in wikipedia under North American Numbering Plan)&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;COLOR: blue&quot;&gt;var&lt;/span&gt; rnd = &lt;span style=&quot;COLOR: blue&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;COLOR: #2b91af&quot;&gt;Random&lt;/span&gt;();&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;COLOR: green&quot;&gt;// A number consists of 3 parts: NPA Nxx Station&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;COLOR: green&quot;&gt;// NPA (Numbering Plan Area code) = [2-9][0-8][0-9] &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;COLOR: green&quot;&gt;// Exclude common toll and toll-free numbers&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;COLOR: blue&quot;&gt;int&lt;/span&gt; npa = 0;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;COLOR: blue&quot;&gt;while&lt;/span&gt; (npa == 0 || npa == 800 || npa == 877 || npa == 888 || npa == 900)&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; npa = rnd.Next(2, 9) * 100 + rnd.Next(0, 8) * 10 + rnd.Next(9);&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;COLOR: green&quot;&gt;// NXX (Central Office or Exchange code) = [2-9][0-9][0-9]&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;COLOR: green&quot;&gt;// Exception the second digits may not be 11&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;COLOR: blue&quot;&gt;int&lt;/span&gt; nxx = 0;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;COLOR: blue&quot;&gt;while&lt;/span&gt; (nxx == 0 || nxx % 100 == 11)&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; nxx = rnd.Next(2, 9)*100 + rnd.Next(99);&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;COLOR: green&quot;&gt;// Station code = [0-9][0-9][0-9][0-9]&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;COLOR: green&quot;&gt;// When 555 is the NXX the number 100-199 are reserved or fictional numbers)&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;COLOR: blue&quot;&gt;int&lt;/span&gt; station = 0;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;COLOR: blue&quot;&gt;while&lt;/span&gt; (station == 0 || (nxx == 555 &amp;amp;&amp;amp; station &amp;gt; 99 &amp;amp;&amp;amp; station &amp;lt; 200))&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; station = rnd.Next(9999);&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;COLOR: blue&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;COLOR: blue&quot;&gt;string&lt;/span&gt; format = &lt;span style=&quot;COLOR: #a31515&quot;&gt;&quot;({0:000}) {1:000}-{2:0000}&quot;&lt;/span&gt;;&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;COLOR: blue&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;COLOR: blue&quot;&gt;string&lt;/span&gt;.Format(format, npa, nxx, station);&lt;/p&gt;&lt;br /&gt;&lt;p style=&quot;MARGIN: 0px&quot;&gt;}&lt;/p&gt;&lt;/div&gt;&lt;!--EndFragment--&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Now playing:&lt;/strong&gt; &lt;a href=&quot;http://phobos.apple.com/WebObjects/MZSearch.woa/wa/advancedSearchResults?artistTerm=Hans Zimmer &amp;amp; James Newton Howard&quot;&gt;Hans Zimmer &amp;amp; James Newton Howard&lt;/a&gt; - &lt;a href=&quot;http://phobos.apple.com/WebObjects/MZSearch.woa/wa/advancedSearchResults?songTerm=Macrotus&amp;amp;artistTerm=Hans Zimmer &amp;amp; James Newton Howard&quot;&gt;Macrotus&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/9068304190217238327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2008/08/generating-artificial-phone-numbers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/9068304190217238327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/9068304190217238327'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2008/08/generating-artificial-phone-numbers.html' title='Generating artificial phone numbers'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-717175043235444527</id><published>2008-08-19T21:12:00.000-07:00</published><updated>2009-03-12T14:34:50.744-07:00</updated><title type='text'>Handy script to launch a solution file from the command line</title><content type='html'>&lt;p&gt;Before &lt;a href=&quot;http://www.jetbrains.com/resharper&quot; target=&quot;_blank&quot;&gt;Resharper&lt;/a&gt; came along and clutter my directories with files, I used tab-completion to launch my solution files from the command line using:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;START MyApplication.sln&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p dir=&quot;ltr&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/8061254@N07/2779638963/&quot;&gt;&lt;img alt=&quot;commandline&quot; hspace=&quot;5&quot; src=&quot;http://static.flickr.com/3061/2779638963_01c6c4bd6a.jpg&quot; align=&quot;right&quot; vspace=&quot;5&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;But, with two other resharper files now preceeding the solution file I needed another way to launch the solutution file. Here’s the script that I came up with:&lt;/p&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;p dir=&quot;ltr&quot;&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;@&lt;a href=&quot;http://technet.microsoft.com/en-us/library/cc756140.aspx&quot; target=&quot;_blank&quot;&gt;ECHO&lt;/a&gt; OFF&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;ltr&quot;&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;&lt;a href=&quot;http://technet.microsoft.com/en-us/library/cc755694.aspx&quot; target=&quot;_blank&quot;&gt;FOR&lt;/a&gt; %%n IN (*.sln) DO START %%n&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p dir=&quot;ltr&quot;&gt;If you have more than one solution file in the same directory, this script is not for you, but that is not a likely scenario. I saved this file as sln.bat and put in the \windows\system32 directory, although any directory in your PATH will do.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/717175043235444527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2008/08/handy-script-to-launch-solution-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/717175043235444527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/717175043235444527'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2008/08/handy-script-to-launch-solution-file.html' title='Handy script to launch a solution file from the command line'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-6320800436105748909</id><published>2008-08-18T20:03:00.000-07:00</published><updated>2009-03-12T14:34:50.749-07:00</updated><title type='text'>Parsing Flat files and new Data 2.0 - Part I</title><content type='html'>&lt;p&gt;This is the first of a two part article on parsing a fixed length line delimited set of records into a C# Object. This month’s MSDN Magazine featured two articles that caught my eye. The first, was the &lt;a title=&quot;Toolbox by Scott Mitchell&quot; href=&quot;http://msdn.microsoft.com/en-us/magazine/cc721607.aspx&quot; target=&quot;_blank&quot;&gt;Toolbox&lt;/a&gt; written by Scott Mitchell where he makes reference of an open source project &lt;a title=&quot;filehelpers.com Marcos Meli&quot; href=&quot;http://filehelpers.com/&quot; target=&quot;_blank&quot;&gt;filehelpers.com&lt;/a&gt; by Marcos Meli. I was excited to see this as a few of our projects need this type of support for manipulating text based data and this seemed to have all of the features that I wanted. The second article I will take a look at the new &lt;a href=&quot;http://msdn.microsoft.com/en-us/magazine/cc748663.aspx&quot; target=&quot;_blank&quot;&gt;Data 2.0&lt;/a&gt; features that were released with Visual Studio 2008 SP1 and .NET 3.5 SP1 (see &lt;a href=&quot;http://www.hanselman.com/blog/HiddenGemsNotTheSameOld35SP1Post.aspx&quot; target=&quot;_blank&quot;&gt;Scott Hanselman’s posting&lt;/a&gt;).&lt;/p&gt;&lt;p&gt;Here’s the brief little demo that I want to build as a console application in .NET 3.5. Read a flat file containing prescribers. This happens to be defined by SureScripts and is a format that we use with our eScript Messenger product.&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/8061254@N07/2776191741/&quot;&gt;&lt;img alt=&quot;sample-1&quot; src=&quot;http://static.flickr.com/3247/2776191741_10db20922b.jpg&quot; vspace=&quot;5&quot; border=&quot;0&quot; hspace=&quot;5&quot; /&gt;&lt;/a&gt;&lt;/p&gt;There are 42 fields in the 4.0 format of this file. I fired up the FileHelpers Wizard and proceeded to type in the details on the 42 records. The wizard takes you through a series of four dialogs that ask you details on the record structure you will read (fixed length or delimited), the name of the class and the visibility of that class as well as a few more pages on how many fields each of your records will contain. There is support for ignoring the first N or last N lines, ignoring empty lines as well as identifying a comment marker. For the more advanced usages you can even selectively filter each of the records bases on conditions that you provide.&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/8061254@N07/2777047314/&quot;&gt;&lt;img alt=&quot;sample-2&quot; src=&quot;http://static.flickr.com/3249/2777047314_cbcbabd3fc.jpg&quot; vspace=&quot;5&quot; border=&quot;0&quot; hspace=&quot;5&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.flickr.com/photos/8061254@N07/2777047314/&quot;&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/8061254@N07/2776191969/&quot;&gt;&lt;/a&gt;&lt;img alt=&quot;sample-2a&quot; src=&quot;http://static.flickr.com/3042/2776191969_d74177b5f2_t.jpg&quot; vspace=&quot;5&quot; align=&quot;left&quot; border=&quot;0&quot; hspace=&quot;5&quot; /&gt;Above is a sample that I entered with a preview of the class that the wizard creates for you. Take a look at the button in the lower left. That is a really nifty button that allows you to test your definitions &lt;strong&gt;before&lt;/strong&gt; you copy/save the code files out to your project! Marcos really deserves a lot of credit for a well thought out application.&lt;/p&gt;Before I gush with too many more accolades for FileHelpers, I should point out a couple of issues that I ran into while putting this together. While you can see the optional field checkboxes checked in the dialog above, I discovered that you can only check the Optional Field check box on fields if all of the following fields also have it checked as well. I was presented with an error dialog, but it would have been nicer to see that in the field designer. Hey its free/donation ware.&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/8061254@N07/2777047548/&quot;&gt;&lt;img alt=&quot;sample-2b&quot; src=&quot;http://static.flickr.com/3098/2777047548_41c2369cdf.jpg&quot; vspace=&quot;5&quot; border=&quot;0&quot; hspace=&quot;5&quot; /&gt;&lt;/a&gt;&lt;/p&gt;After I went back and removed all of the optional fields all was well and I was presented with a nice Grid View showing all of the data that I had in my sample data file. Now that is very nice as it reminds me of the old days when I imported flat files into Microsoft Access database and such.&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/8061254@N07/2776191795/&quot;&gt;&lt;img alt=&quot;sample-3&quot; src=&quot;http://static.flickr.com/3133/2776191795_3a8e628386.jpg&quot; vspace=&quot;5&quot; border=&quot;0&quot; hspace=&quot;5&quot; /&gt;&lt;/a&gt;&lt;/p&gt;To finish this off I saved the generated class as as well as the handy template for loading the sample data, fired up Visual Studio 2008 and created a new console application. Below is the source to read in all of the records:&lt;br /&gt;&lt;br /&gt;&lt;div    style=&quot;border: 1px solid rgb(165, 42, 42); padding: 5px; background: rgb(245, 245, 220) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-family:Courier New;font-size:10pt;color:black;&quot;&gt;&lt;span style=&quot;color:blue;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color:blue;&quot;&gt;void&lt;/span&gt; Main()&lt;br /&gt;{&lt;p style=&quot;margin: 0px;&quot;&gt;      &lt;span style=&quot;color:blue;&quot;&gt;using&lt;/span&gt; (&lt;span style=&quot;color:blue;&quot;&gt;var&lt;/span&gt; engine = &lt;span style=&quot;color:blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;FileHelperAsyncEngine&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Prescriber&lt;/span&gt;&amp;gt;())&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;      {&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;            engine.BeginReadFile(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;@&quot;..\..\sample.txt&quot;&lt;/span&gt;);&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt; &lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;            &lt;span style=&quot;color:blue;&quot;&gt;while&lt;/span&gt; (engine.ReadNext() != &lt;span style=&quot;color:blue;&quot;&gt;null&lt;/span&gt;)&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;            {&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;                  &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Prescriber&lt;/span&gt; record = engine.LastRecord;&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;                  &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;{0}, {1}&quot;&lt;/span&gt;, record.LastName, record.FirstName);&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;            }&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;    }&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;}&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/8061254@N07/2777047598/&quot;&gt;&lt;img alt=&quot;sample-3a&quot; src=&quot;http://static.flickr.com/3194/2777047598_627b9e861b_m.jpg&quot; vspace=&quot;5&quot; align=&quot;right&quot; border=&quot;0&quot; hspace=&quot;5&quot; /&gt;&lt;/a&gt;That’s really all there was to it. I changed the original template a little to use .NET 3.5 var’s which I am liking more after my initial impressions of them. Incidently, I blame Resharper for that as it likes to provide too many of those helpful hints about changing the variable to an explicit type definition. &lt;/p&gt;So there you have it. I had never used FileHelpers before and had a working prototype up and running in under 20 minutes. I saved the definition file for the flat file so I can go back and make changes to it in the future if necessary.&lt;br /&gt;&lt;p&gt;Here’s the console running in all of its glory. What would we do without our old friends Harry Winston and Anthony Cardino!&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/8061254@N07/2776191951/&quot;&gt;&lt;img alt=&quot;sample-4&quot; src=&quot;http://static.flickr.com/3159/2776191951_1b070b5367.jpg&quot; vspace=&quot;5&quot; border=&quot;0&quot; hspace=&quot;5&quot; /&gt;&lt;/a&gt;&lt;/p&gt;In Part II I will show how to use the new .NET 3.5 (or 3.6 as Hanselman sez) and stich up some simple data access using LINQ and the new SP1 features.&lt;!--EndFragment--&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/6320800436105748909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2008/08/parsing-flat-files-and-new-data-20-part.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/6320800436105748909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/6320800436105748909'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2008/08/parsing-flat-files-and-new-data-20-part.html' title='Parsing Flat files and new Data 2.0 - Part I'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-762309920530546523</id><published>2007-12-11T18:34:00.000-08:00</published><updated>2009-03-12T14:34:50.758-07:00</updated><title type='text'>.NET 3.5, NAnt and CruiseControl.NET</title><content type='html'>&lt;p&gt;My build server at work is a VM that does not have VS 2005/8 installed on it. I like to keep it that way because it keeps the large install footprint from being replicated to the build machine. All of the installs that we do at my company can be build from NAnt command line or we can build inside of VS.&lt;/p&gt;&lt;p&gt;.NET 3.5 and VS 2008 specifically, changed how the tools required to build using NAnt are deployed. Here are the steps I went through in order to get our solutions that were .NET 2.0/VS2005 buildable using NAnt 0.85 w/ NAntContrib running under .NET 3.5:&lt;/p&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Download the .NET 3.5 Runtime available &lt;a title=&quot;.NET 3.5 Runtime&quot; href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyId=333325FD-AE52-4E35-B531-508D977D32A6&amp;amp;displaylang=en&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Download the NAnt 0.86 Beta 1 &lt;a title=&quot;NAnt Home Page&quot; href=&quot;http://nant.sourceforge.net/&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Download the NAntContrib 0.85 Nightly &lt;a title=&quot;NAntContrib Nightly&quot; href=&quot;http://nantcontrib.sourceforge.net/nightly/2007-12-01-0.86/&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;&lt;/li&gt;&lt;li&gt;If you now attempt to run a nant build file you might find you get an error like&lt;/li&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj51f9rPUg1bjjxoaaXnO1fToESn_4-5Q2saEhpY2OqBTWYLGMO-SfOxcNsP6RdpYJ7zq7DIkzl3o4G6k9SX_0J_v91vZTkTWo8cXdLSUJto0NNmIu6UJbjzg6km3uPAlbPysOgzlPSXO7U/s1600-h/nant20fail.png&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5142910728882027506&quot; style=&quot;CURSOR: hand&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj51f9rPUg1bjjxoaaXnO1fToESn_4-5Q2saEhpY2OqBTWYLGMO-SfOxcNsP6RdpYJ7zq7DIkzl3o4G6k9SX_0J_v91vZTkTWo8cXdLSUJto0NNmIu6UJbjzg6km3uPAlbPysOgzlPSXO7U/s400/nant20fail.png&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;There are several key components that are no longed installed into the RuntimeDirectory (aka C:\Windows\Microsoft.NET\Framework\v3.5. Things like the gacutil, sn.exe, xsd.exe, svcutil.exe etc… are missing.) These can now be found at C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin, but only if you install some extra things from the VS 2008 install CD.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;On my CD obtained during the padnug VS2008 Install Party (or alternatively in the ISO you can download from MS). Open the \WCU\WinSDK folder and grab the WinSDK_*.exe files. Copy these up to your build server, and then extract the bits using WinZip (or your favorite ZIP archive program). I noted that you could not run the EXEs directly, note there might be a better way to do this via the VS 2008 Installer CD, but I was following some instructions and a hunch based on &lt;a class=&quot;homelink1&quot; href=&quot;http://jclabaut.free.fr/serendipity/index.php?/archives/40-Visual-studio-2008-installation-problem.html&quot; target=&quot;_blank&quot;&gt;Blog de Jérémie Clabaut&lt;/a&gt;. (Incidently, I google’d ‘visual studio 2008 SDK gacutil’ to find this)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Once you’ve run the .msi’s that you extracted, you should find gacutil and friends in their new location at C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin. I believe that you only need to install the WinSDK_W32Tools.exe and WinSDK_NetFxTools.exe, but I installed all five of them.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p&gt;Currently, my projects are still using .NET 2.0 and not .NET 3.5. Most likely there will be some gotchas as most of our stack uses components like NHibernate 1.2, log4.net, etc… that I’ve not yet tested to make sure they work with .NET 3.5. VS 2008 seems to run a lot faster! I’ve not installed any of my old favorite AddIns yet though like, Copy As HTML or Resharper.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;One other notable thing: the Cassini Web Server that runs your HTTP applications without deploying to IIS has also changed locations and is located at: C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0\WebDev.WebServer.EXE.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/762309920530546523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2007/12/net-35-nant-and-cruisecontrolnet.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/762309920530546523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/762309920530546523'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2007/12/net-35-nant-and-cruisecontrolnet.html' title='.NET 3.5, NAnt and CruiseControl.NET'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj51f9rPUg1bjjxoaaXnO1fToESn_4-5Q2saEhpY2OqBTWYLGMO-SfOxcNsP6RdpYJ7zq7DIkzl3o4G6k9SX_0J_v91vZTkTWo8cXdLSUJto0NNmIu6UJbjzg6km3uPAlbPysOgzlPSXO7U/s72-c/nant20fail.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7861049761445932376.post-7920416800844232367</id><published>2007-09-06T23:35:00.000-07:00</published><updated>2009-03-12T14:34:50.764-07:00</updated><title type='text'>VMware Workstation, Dell D620 Laptop, and Intel SpeedStep... oh boy!</title><content type='html'>It turns out that SpeedStep on a laptop is a really bad thing when you are trying to use a VM. The symptoms are that the clock in the VM runs about twice as fast. Note that my laptop report a minimum processor speed of ~1GHz and max at 2GHz. So I noticed that the real clock was record seconds go by between 1.5 - 2x faster than normal! This might explain why a coworked and I could not get our VMs to function correctly on a demo visit to a partner&#39;s office. To fix it I rebooted, turned off SpeedStep in the BIOS.&lt;br /&gt;&lt;br /&gt;When I don&#39;t have a VM on my laptop, i.e. after vacation, I will restore the SpeedStep.</content><link rel='replies' type='application/atom+xml' href='http://codemonkeyking.blogspot.com/feeds/7920416800844232367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemonkeyking.blogspot.com/2007/09/vmware-workstation-dell-d620-laptop-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/7920416800844232367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7861049761445932376/posts/default/7920416800844232367'/><link rel='alternate' type='text/html' href='http://codemonkeyking.blogspot.com/2007/09/vmware-workstation-dell-d620-laptop-and.html' title='VMware Workstation, Dell D620 Laptop, and Intel SpeedStep... oh boy!'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01805029619319986824</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>