<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>.net</title>
        <link>http://geekswithblogs.net/MattRobertsBlog/category/6539.aspx</link>
        <description>.net</description>
        <language>en-GB</language>
        <copyright>Matt Roberts</copyright>
        <managingEditor>roberts.mattroberts@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>The awesomeness of TeamCity</title>
            <link>http://geekswithblogs.net/MattRobertsBlog/archive/2010/08/11/the-awesomeness-of-teamcity.aspx</link>
            <description>&lt;p&gt;At my current place, we’ve set up TeamCity as our build server. Previously I’ve used CruiseControl.net and never really questioned it – it works, it does the job, seemed quite nice if a little fiddly to setup.&lt;/p&gt;
&lt;p&gt;(If you’re thinking “Hang on, Team City isn't free is it?”  - well there is a  free version that is limited to a limited number of projects,  configurations and agents – check &lt;a href="http://www.jetbrains.com/teamcity/"&gt;the site&lt;/a&gt; for more details)&lt;/p&gt;
&lt;p&gt;I was a bit sceptical about moving to TeamCity because I didn’t want to feel the pain of setting up yet another build/ci server and spending ages trying to get it working with our nant scripts – turns out I was so so wrong to worry. Team city is awesome! Let me talk you through some of the awesomeness…&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h2&gt;Setting it up is a breeze&lt;/h2&gt;
&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/MattRobertsBlog/WindowsLiveWriter/TheawesomenessofTeamCity_BBE4/tc1_2.png" rel="lightbox"&gt;&lt;img height="356" border="0" width="830" style="border: 0px none; display: inline;" title="tc1" alt="tc1" src="http://geekswithblogs.net/images/geekswithblogs_net/MattRobertsBlog/WindowsLiveWriter/TheawesomenessofTeamCity_BBE4/tc1_thumb.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Its seriously easy to set a build configuration using TeamCity. Its all driven through the nice friendly web interface, so a real breeze to setup. Assuming you have an automated build script of some sort set up for your solution (like nant, nant, maven2, msbuild etc) then its really easy to plumb this into Team City. You can set up multiple build agents for your build really easily too.&lt;/p&gt;
&lt;h2&gt;Fantastic UI&lt;/h2&gt;
&lt;p&gt;So once you’ve got your build set up, you get all the usual stuff like a build history including things like which check-ins caused the build etc. You can drill into previous builds and see what happened – get the full build log, look at the tests, download the artefacts you defined for the build, all good stuff. You can also manually force a build. If a build fails you can set responsibility for fixing too. All of this is present in most (if not all) CI servers, but its just a lot more polished and feature-rich in Team City. &lt;/p&gt;
&lt;h2&gt;Really Awesome Test and Cover Integration&lt;/h2&gt;
&lt;p&gt;This is what got me really excited (maybe I should be worried about that). You get all sorts of great reports/graphs from Team City that are really useful – like this one:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/MattRobertsBlog/WindowsLiveWriter/TheawesomenessofTeamCity_BBE4/tc2_2.png" rel="lightbox"&gt;&lt;img height="175" border="0" width="537" style="border: 0px none; display: inline;" title="tc2" alt="tc2" src="http://geekswithblogs.net/images/geekswithblogs_net/MattRobertsBlog/WindowsLiveWriter/TheawesomenessofTeamCity_BBE4/tc2_thumb.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;This shows a history of a swear word test we have, and how long its been taking to run and on what build agent.&lt;/p&gt;
&lt;p&gt;If you have test coverage set up (like PartCover) then you can also integrate that and you get some really nice reports showing your coverage by class, methods and LOC – you even get an indicator of what the check-in did to improve (or reduce) that coverage – which is an awesome motivator for adding more tests!&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;So, all in all, I really like TeamCity, and I’m glad to be using it. If you’re considering getting a CI server set up for your project, or you want to try another flavour of CI server, &lt;a href="http://www.jetbrains.com/teamcity/"&gt;check it out!&lt;/a&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/MattRobertsBlog/aggbug/141278.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matt Roberts</dc:creator>
            <guid>http://geekswithblogs.net/MattRobertsBlog/archive/2010/08/11/the-awesomeness-of-teamcity.aspx</guid>
            <pubDate>Wed, 11 Aug 2010 12:25:53 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/MattRobertsBlog/comments/141278.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/MattRobertsBlog/archive/2010/08/11/the-awesomeness-of-teamcity.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/MattRobertsBlog/comments/commentRss/141278.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/MattRobertsBlog/services/trackbacks/141278.aspx</trackback:ping>
        </item>
        <item>
            <title>Get Database rollback powers in your NUnit Tests!</title>
            <link>http://geekswithblogs.net/MattRobertsBlog/archive/2008/12/18/get-database-rollback-powers-in-your-nunit-tests.aspx</link>
            <description>&lt;p&gt;Ok - no credit to me for any of this good stuff. All I'm doing here is posting on how to get database rollback working in your Nunit tests.&lt;/p&gt;  &lt;p&gt;Roy Osherove created something called XtUnit - "An Unofficial Unit Testing Extensibility Framework - Add new attributes to NUnit or MbUnit easily" - &lt;a href="http://weblogs.asp.net/rosherove/archive/2004/10/05/238201.aspx"&gt;http://weblogs.asp.net/rosherove/archive/2004/10/05/238201.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;His blog talks you through all the cool stuff that you can do with this framework, like implementing your own attributes to do cool things pre and post method execution. But the thing I wanted more than anything was to add rollback powers to existing NUNit tests, I didn't want to switch to MbUnit to do this, I just wanted to be able to do it with my existing tests.&lt;/p&gt;  &lt;p&gt;It was pretty simple to get working, but the documentation is a tiny bit in-complete, so this is what you need to do.&lt;/p&gt;  &lt;p&gt;I'm in Visual Studio 2008, using LLBLGenPro to talk to the database (obviously you don't need to use LLBLGen Pro, but why the hell not!)&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Download the binaries. You could download the source but you'll need to migrate it to 2008, and I didn't need the src.&lt;/li&gt;    &lt;li&gt;Reference the binary file that is downloaded in your test project.&lt;/li&gt;    &lt;li&gt;Make sure that your test fixture class derives from ExtensibleFixture&lt;/li&gt;    &lt;li&gt;Add the DataRollBack attribute to your test method&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Done!&lt;/p&gt;  &lt;p&gt;Here's the code for completion. My example as basically adding a row to a table called "GlobalSearch", in case the LLBLGen stuff looks confusing to you.&lt;/p&gt;  &lt;div&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; [TestFixture]&lt;/pre&gt;

    &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Class1 : ExtensibleFixture&lt;/pre&gt;

    &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     [Test, DataRollBack]&lt;/pre&gt;

    &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; TestDataRollBack()&lt;/pre&gt;

    &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;         var adapter = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; DataAccessAdapter(&lt;span style="color: #006080"&gt;"connection string here"&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;, CatalogNameUsage.ForceName, &lt;span style="color: #006080"&gt;""&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;         &lt;span style="color: #008000"&gt;// Create a new GlobalSearchEntity, save it, then rollback&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;         var g = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; GlobalSearchQueueEntity();&lt;/pre&gt;

    &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;         g.RecordId = 100;&lt;/pre&gt;

    &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;         g.ToolCode = &lt;span style="color: #006080"&gt;"TOOLCODE"&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;         adapter.SaveEntity(g);&lt;/pre&gt;

    &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt; &lt;img src="http://geekswithblogs.net/MattRobertsBlog/aggbug/128026.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matt Roberts</dc:creator>
            <guid>http://geekswithblogs.net/MattRobertsBlog/archive/2008/12/18/get-database-rollback-powers-in-your-nunit-tests.aspx</guid>
            <pubDate>Fri, 19 Dec 2008 03:26:05 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/MattRobertsBlog/comments/128026.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/MattRobertsBlog/archive/2008/12/18/get-database-rollback-powers-in-your-nunit-tests.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/MattRobertsBlog/comments/commentRss/128026.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/MattRobertsBlog/services/trackbacks/128026.aspx</trackback:ping>
        </item>
        <item>
            <title>How to make a &amp;quot;protected&amp;quot; method available for &amp;quot;partial&amp;quot; mocking using RhinoMocks</title>
            <link>http://geekswithblogs.net/MattRobertsBlog/archive/2008/12/16/how-to-make-a-quotprotectedquot-method-available-for-quotpartialquot-mocking-and-again.aspx</link>
            <description>&lt;p&gt;There are 2 cool things I want to share here...&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Partial Mocking&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;This is a very cool and useful feature of RhinoMocks, which allows you to test part of a class, but have some of it act normally. Its explained very well here: &lt;a href="http://ayende.com/Wiki/(S(gvtu2q45soph42vfyhig2j55))/Rhino+Mocks+Partial+Mocks.ashx"&gt;http://ayende.com/Wiki/(S(gvtu2q45soph42vfyhig2j55))/Rhino+Mocks+Partial+Mocks.ashx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Making "protected" methods available for mocking.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Partial mocks are great, but what do you do when you need to "mock" out a method that isn't visible to your test class - i.e. its private or protected. Well, it turns out you can use a nifty little attribute called InternalsVisibleTo to make any internal methods visible to other assemblies (i.e. your testing assembly). So, in my code, I had a method called &lt;strong&gt;GetRecord&lt;/strong&gt;, which was protected. I changed this to make it &lt;strong&gt;protected internal virtual&lt;/strong&gt;, and added this to my AssemblyInfo.cs file:&lt;/p&gt;  &lt;div&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; [assembly: InternalsVisibleTo(&lt;span style="color: #006080"&gt;"NUnitTests"&lt;/span&gt;)] &lt;/pre&gt;

    &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; [assembly: InternalsVisibleTo(RhinoMocks.NormalName)] &lt;/pre&gt;

    &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; [assembly: InternalsVisibleTo(RhinoMocks.StrongName)] &lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;NUnitTests is the name of my assembly that contains the tests for my project. Once this is done and compiled, intellisense lets me mock that protected method. Just for completeness, here is the code that sets up my partial mock:&lt;/p&gt;

&lt;div style="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, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; var mocks = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MockRepository(); &lt;/pre&gt;

    &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; var globalSearchServiceBase = mocks.PartialMock&amp;lt;ClassToMock&amp;gt;(); &lt;/pre&gt;

    &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; Expect.Call(globalSearchServiceBase.GetRecord(1)).IgnoreArguments().Return(GetFakeData()); &lt;/pre&gt;

    &lt;pre style="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, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; mocks.ReplayAll(); &lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Thats it. Hope that was at least marginally useful to someone :)&lt;/p&gt; &lt;img src="http://geekswithblogs.net/MattRobertsBlog/aggbug/127972.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matt Roberts</dc:creator>
            <guid>http://geekswithblogs.net/MattRobertsBlog/archive/2008/12/16/how-to-make-a-quotprotectedquot-method-available-for-quotpartialquot-mocking-and-again.aspx</guid>
            <pubDate>Tue, 16 Dec 2008 23:00:18 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/MattRobertsBlog/comments/127972.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/MattRobertsBlog/archive/2008/12/16/how-to-make-a-quotprotectedquot-method-available-for-quotpartialquot-mocking-and-again.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/MattRobertsBlog/comments/commentRss/127972.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/MattRobertsBlog/services/trackbacks/127972.aspx</trackback:ping>
        </item>
        <item>
            <title>Get your (old) COM-based or &amp;quot;ASP.NET with Interop&amp;quot; web app working in Windows Server 2003 R2 64 Bit !</title>
            <link>http://geekswithblogs.net/MattRobertsBlog/archive/2008/04/11/get-your-old-com-based-or-quotasp.net-with-interopquot-web-app.aspx</link>
            <description>&lt;p&gt;&lt;font size="1"&gt;AKA: "Why am I getting 'ActiveX can't create component' when I try to access my COM DLL's"     &lt;br /&gt;AKA: "Why am I getting 'Service Unavailable' when I've set IIS to run in 32 bit compatibility mode.      &lt;br /&gt;AKA "Why do I get 404 errors when I browse to my ASPX pages"&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Man that's a long title :) &lt;/p&gt;  &lt;p&gt;So, I recently had to spend some time looking into getting my companies web application working in 64 Bit Windows (2003 R2 to be exact). I eventually got this working, but found the information scattered and incomplete on the interweb, so this little guide should see you through. I hope someone out there finds it useful. &lt;/p&gt;  &lt;p&gt;Starting Point.&lt;/p&gt;  &lt;p&gt;You have windows 2003 R2 64 bit SP1. You have the 64bit version of the .NET framework (V2 or higher) installed. No other changes have been made to IIS - it seems to run just fine for serving .NET and HTML. You install your web application that includes COM, try to run it, and BANG...&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Microsoft VBScript runtime error '800a01ad'      &lt;br /&gt;ActiveX component can't create object&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The cause? Its because those COM objects are 32 bit components, and by default IIS won't work with 32 components. You need to tell IIS to run in 32 bit compatibility mode (WOW64). To do this, you need to configure IIS to run in 32 bit compatibility mode, as explained by &lt;a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/405f5bb5-87a3-43d2-8138-54b75db73aa1.mspx?mfr=true"&gt;this link&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;But wait! Its not quite that easy! If you do this, then you're telling IIS to run in 32 bit mode, but then you've already got the 64 bit ASP.NET DLL's registered with IIS, so the first time you hit your app, you'll probably see a big fat "Service Unavailable" Error message. If you look in the event log, you'll see your application pools are crashing with this error:&lt;/p&gt;  &lt;pre class="alt"&gt;A process serving application pool 'DefaultAppPool' reported a failure.&lt;br /&gt;The process id was '4156'. The data field contains the error number.&lt;/pre&gt;

&lt;p&gt;So, you need to register the 32 bit ASP.NET DLL's with IIS. But wait! You can't do that before you un-register the existing 64 bit ones.&lt;/p&gt;

&lt;p&gt;Enough waffling. Here's the step-by-step :-&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Un-register the 64 bit ASP.NET DLL's. In a command prompt, navigate to C:\Windows\Framework64\v2.0.50727\ and from there run "aspnet_regiis -u" &lt;/li&gt;

  &lt;li&gt;Set IIS to work in 32 bit compatibility (WOW64) mode: 
    &lt;br /&gt;cscript &lt;var&gt;c&lt;/var&gt;:\inetpub\AdminScripts\adsutil.vbs set w3svc/AppPools/Enable32BitAppOnWin64 1 &lt;/li&gt;

  &lt;li&gt;Register the 32-Bit ASP.NET DLL's. Navigate to C:\Windows\Framework\v2.0.50727\ and from there run "aspnet_regiis -i" &lt;/li&gt;

  &lt;li&gt;Finally, in IIS, Navigate to "Web Service Extensions", and make sure that ASP.NET is "allowed". &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You're done! 
  &lt;/p&gt; &lt;img src="http://geekswithblogs.net/MattRobertsBlog/aggbug/121186.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matt Roberts</dc:creator>
            <guid>http://geekswithblogs.net/MattRobertsBlog/archive/2008/04/11/get-your-old-com-based-or-quotasp.net-with-interopquot-web-app.aspx</guid>
            <pubDate>Fri, 11 Apr 2008 20:27:23 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/MattRobertsBlog/comments/121186.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/MattRobertsBlog/archive/2008/04/11/get-your-old-com-based-or-quotasp.net-with-interopquot-web-app.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/MattRobertsBlog/comments/commentRss/121186.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/MattRobertsBlog/services/trackbacks/121186.aspx</trackback:ping>
        </item>
        <item>
            <title>Categories in Rails</title>
            <link>http://geekswithblogs.net/MattRobertsBlog/archive/2007/12/14/categories-in-rails.aspx</link>
            <description>&lt;p&gt;Rails makes such a nice change from coding in .NET. I mean, I do like .NET and C#, but sometimes its very bloated and can be quite cumbersome to do things. &lt;/p&gt;  &lt;p&gt;Rails, on the other hand, isn't big. Or cumbersome. In fact, its downright lean and to-the-point, unlike my blog posts (what there are of them!). &lt;/p&gt;  &lt;p&gt;Anyway, today we're talking category trees, surely one of the most exciting concepts that there is to talk about. One thing that made me smile recently was the need to list all the categories that a company was tagged to. So, this happens with code that looks like this :-&lt;/p&gt;  &lt;p&gt;&amp;lt;%for cat in @Categories %&amp;gt;    &lt;br /&gt;    &amp;lt;%= cat.name + "&amp;lt;br&amp;gt;" %&amp;gt;     &lt;br /&gt;&amp;lt;% end %&amp;gt; &lt;/p&gt;  &lt;p&gt;.. Where @Categories is a collection of categories from the controller, and is generated like this:&lt;/p&gt;  &lt;p&gt;@Categories = Company.find(params["id"]).Category.find(:all)&lt;/p&gt;  &lt;p&gt;So, this noddy code just lists all cats that the company was tagged to. After deploying this, I was asked to change it so that the full hierarchy of categories was displayed. So instead of "Cat 1", the user wants to see "Root -&amp;gt; Services -&amp;gt; Cat 1". Hmmm, I thought, perhaps I need to write a little recursive method to go and get the parent nodes of each selected category... Turns out that because I was using acts_as_tree in the model (google it!), I was able to solve this with a really simple bit of code added to the category model :-&lt;/p&gt;  &lt;p&gt;    def fullcategoryname    &lt;br /&gt;        self.ancestors().each() { |parent| fullname += parent.name + " / " }     &lt;br /&gt;        fullname += self.name     &lt;br /&gt;  end&lt;/p&gt;  &lt;p&gt;Thats nice! :) Gotta like Ruby.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/MattRobertsBlog/aggbug/117702.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Matt Roberts</dc:creator>
            <guid>http://geekswithblogs.net/MattRobertsBlog/archive/2007/12/14/categories-in-rails.aspx</guid>
            <pubDate>Sat, 15 Dec 2007 00:00:46 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/MattRobertsBlog/comments/117702.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/MattRobertsBlog/archive/2007/12/14/categories-in-rails.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/MattRobertsBlog/comments/commentRss/117702.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/MattRobertsBlog/services/trackbacks/117702.aspx</trackback:ping>
        </item>
    </channel>
</rss>
