views:

205

answers:

3

When I launch CruiseControl.NET with a particular configuration file I receive the following error:

ThoughtWorks.CruiseControl.Core.Config.ConfigurationException: Duplicate node detected

What does this mean, and what causes it?

+1  A: 

I think you have 2 nodes in your config where it only expected one. Is there any chance you could post the config file it is throwing the exception on here as additional information? I'm using cruisecontrol (not the .net version) currently and find it can be very picky about it's XML files (rightly so) but not tell you anything about where in the file the exceptions were thrown from.

workmad3
+1  A: 

I found that I had an incorrectly structured config file. In particular, some blocks were outside of the configuration section. The error pointed to the second of these exec sections- apparently it didn't like that there was more than one of a given section inside the project.

Thus, the error occurred due a config file like this:

<project>
  <tasks>
    ...
  </tasks>
  <exec>...</exec>
  <exec>...</exec>
<project>
Noah Jacobson
I was typing up a response when I saw this ... My response is no longer needed. :) What did you do to correct this issue?
John Rudy
The real problem was that <exec> isn't valid outside of a task block, so I moved them into it, and I'm then allowed to have more than one.
Noah Jacobson
+1  A: 

In my case I had something like:

<task>...</task>
<sourceControls>...</sourceControls>
<task>...</task>
<publishers>...</publishers>

It didn't like the two "<task>" nodes so I fixed it by removing the first "<task>" node. I was trying to do some stuff before getting the latest from svn, and then doing the build after that in the second "<task>" node. I'll need to revisit how to do that...any suggestions?

Steve J
You could prevent CC from checking out the source, in the source control block, and then check it out via an exec or other task inside the task block.
Noah Jacobson