• 30Jun

    Another maddening bout with misleading error messages.

    Running the build on our build server using nant worked perfectly. That is until CruiseControl.Net tried to run it and I got

    Invalid element <msbuild>. Unknown task or datatype.

    I installed nantcontrib in the same folder as nant so it just automatically picked up the additional tasks. Everything pointed to something different in the environment, but what? I finally tried loading the tasks explicitly from the nant build file using:

    <loadtasks assembly="${path::combine(nant::get-base-directory(),'NAnt.Contrib.Tasks.dll')}" />

    and I got an error message that was actually helpful:

    Failure scanning "C:\Program Files\Nant\bin\NAnt.Contrib.Tasks.dll" for extensions.
    Could not load file or assembly 'file:///C:\Program Files\Nant\bin\NAnt.Contrib.Tasks.dll' or one of its dependencies. Access is denied.

    Ah… Permissions. A quick check on the permissions revealed that for some reason the nantcontrib files had different permissions from the rest of the files in the folder which didn’t allow the ccnet service to see them. I won’t even try to understand why the permissions end up that way, but just chalk it up to one of the ‘joys’ of working with Windows.

  • 29Jun

    It took way longer to set up an msbuild using the nant msbuild task than it should have.

    I started out with:

    <msbuild project="Solution.sln">
    <property name="Configuration" value="Release"/>
    <property name="OutDir" value="${dir.output}"/>

    I got a error message saying that the OutDir needed to end in a slash. So I changed it to this:

    <msbuild project="Solution.sln">
    <property name="Configuration" value="Release"/>
    <property name="OutDir" value="${dir.output}\"/>

    Which lead to the not so helpful error message ‘illegal characters in path’. Only the path was as simple as can be without any possible illegal characters or spaces or anything. After hours of searching I found a comment at the bottom of this blog post with the trick. I need two slashes at the end of the path!

    Here is the code that worked:

    <msbuild project="Solution.sln">
    <property name="Configuration" value="Release"/>
    <property name="OutDir" value="${dir.output}\\"/>

    Obvious, right? ;-)

  • 28Jul

    Earlier this year a new member of the dev team convinced us we should use Sandcastle to generate documentation for our C# code. I like the idea of publishing documentation and didn’t have anything yet, so gave the go-ahead to set it up. We ran into all sorts of issues, but after several days finally got it working with our continuous integration and automatically published the documentation our dev server. I was pleased.

    The problem is, nobody used it. The output was only organized by namespace and didn’t have any type of search. So you have to guess the namespace and drill down to find what you are looking for. It felt like a reference book without an index.

    After running across some recommendations for Doxygen and reviewing sample output, I thought I would give it a shot. I played around with it for a bit then set it up with CruiseControl.net and publishing to our build server within a couple hours.