• 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.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>